44. Contoh Program Operator Not
#include <iostream>
using namespace std;
int main(){
int a, b, c;
cout<<"Masukan Nilai A = "; cin>>a;
b = (a + 8 < 12);
c = !(b);
cout<<"\n=== Program Ekspresi NOT ===";
cout<<"\nNilai A = "<<a;
cout<<"\nNilai b = (a + 8 < 12) = "<<b;
cout<<"\nNilai c = !(b) = "<<c;
return 0;
}
#include <iostream>
using namespace std;
int main(){
int a, b, c;
cout<<"Masukan Nilai A = "; cin>>a;
b = (a + 8 < 12);
c = !(b);
cout<<"\n=== Program Ekspresi NOT ===";
cout<<"\nNilai A = "<<a;
cout<<"\nNilai b = (a + 8 < 12) = "<<b;
cout<<"\nNilai c = !(b) = "<<c;
return 0;
}
Komentar
Posting Komentar