Contoh Operation Relasi C++
|TASK I|
Pertemuan 03
Pertemuan 03
Foto di atas adalah Operation Relasi pada C++
#include <stdio.h>
#include <conio.h>
#include <iostream>
main ()
{
int x = 7, y = 3, a, b, c, d, e, f;
clrscr();
cout<<"============================="<<endl;
cout<<"\nOperation Relasi C++\n"<<endl;
cout<<"=============================="<<endl;
a=x==y; b=x!=y;
c=x>y; d=x<y;
e=x>=y; f=x<=y;
cout<<" Apakah " << x << " < " << y << " ? "<<a<<endl;
cout<<" Apakah " << x << " > " << y << " ? "<<b<<endl;
cout<<" Apakah " << x << " != " << y << " ? "<<c<<endl;
cout<<" Apakah " << x << " <= " << y << " ? "<<d<<endl;
cout<<" Apakah " << x << " >= " << y << " ? "<<e<<endl;
cout<<" Apakah " << x << " == " << y << " ? "<<f<<endl;
getch();
}
//copyright AZ
Thankyou..
Boong boong
BalasHapus