Program Operator Perbandingan Menggunakan Dev C++
Program Operator Perbandingan Menggunakan Dev C++:
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
a=20;
b=10;
cout<<"operator perbandingan\n";
cout<<"www.ibmb.ac.id\n\n";
cout<<"a=20\nb=10\n\n";
cout<<"0 artinya salah\n1 artinya benar\n\n";
c=(a==b);
cout<<"a==b hasilnya "<<c<<endl;
c=(a!=b);
cout<<"a!=b hasilnya "<<c<<endl;
c=(a>b);
cout<<"a>b hasilnya "<<c<<endl;
c=(a<b);
cout<<"a<b hasilnya "<<c<<endl;
c=(a>=b);
cout<<"a>=b hasilnya "<<c<<endl;
}
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
a=20;
b=10;
cout<<"operator perbandingan\n";
cout<<"www.ibmb.ac.id\n\n";
cout<<"a=20\nb=10\n\n";
cout<<"0 artinya salah\n1 artinya benar\n\n";
c=(a==b);
cout<<"a==b hasilnya "<<c<<endl;
c=(a!=b);
cout<<"a!=b hasilnya "<<c<<endl;
c=(a>b);
cout<<"a>b hasilnya "<<c<<endl;
c=(a<b);
cout<<"a<b hasilnya "<<c<<endl;
c=(a>=b);
cout<<"a>=b hasilnya "<<c<<endl;
}
Komentar
Posting Komentar