Program Operator RELASI |
/*filename = Program Operator RELASI (<, <=, >, >=, ==, !=) */
/*Oleh : fk_seven */
/*Date : 14 Agustus 2011 */
//Operator RELASI (<, <=, >, >=, ==, !=)
#include <iostream.h>
#include <conio.h>
main()
{
int a, b, c, d, e, f, X, Y;
gotoxy(10,3);cout<<"Program OPERASI RELASI";
gotoxy(7,4) ;cout<<"----------------------------";
gotoxy(9,6) ;cout<<"Inputkan Nilai X : "; cin>>X;
gotoxy(9,7) ;cout<<"Inputkan Nilai Y : "; cin>>Y;
a = X == Y;
b = X != Y;
c = X > Y;
d = X < Y;
e = X >= Y;
f = X <= Y;
gotoxy(9,9) ;cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<a;
gotoxy(9,10);cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<b;
gotoxy(9,11);cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<c;
gotoxy(9,12);cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<d;
gotoxy(9,13);cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<e;
gotoxy(9,14);cout<<"Hasil dari "<<X<<" == "<<Y<<" --> "<<f;
getch();
}
0 komentar:
Posting Komentar