Google Translate

Konversi nilai dari angka ke huruf C++

user akan menginputkan sebuah nilai/angka kemudian program ini akan mengkonversinya dalam bentuk huruf.


#include <iostream.h>
#include <conio.h>
void main()
{
int nilai;
clrscr();
cout<<"masukan nilai anda:";cin>>nilai;
if((100>=nilai)&&(nilai>80))
{
cout<<"A";
}
else if((80>=nilai)&&(nilai>60))
{
cout<<"B";
}
else if((60>=nilai)&&(nilai>40))
{
cout<<"C";
}
else if((40>=nilai)&&(nilai>20))
{
cout<<"D";
}
else if((20>=nilai)&&(nilai>0))
{
cout<<"E";
}
getch();
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© ILMU TEKNIK INFORMATIKA
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top