Menentukan Perbandingan Nilai

Posted by Budi Arieyanto | Posted in | Posted on 04.46

#include<stdio.h>
#include<iostream.h>
#include<conio.h>

void main()
{
int x;
clrscr();

cout<<"masukan x=";cin>>x;

if(x>=0&x<=50)
cout<<"bilangan E"<<endl;

else
if(x>=51&x<=60)
cout<<"bilangan D"<<endl;

else
if(x>=61&x<=70)
cout<<"bilangan C"<<endl;

else
if(x>=71&x<=80)
cout<<"bilangan B"<<endl;

 else
if(x>=81&x<=100)
 cout<<"bilangan A"<<endl;

getch();
}

Comments (0)

Posting Komentar