int main()
{ int a, b, c; //inisialisasi variabel a = 2; b = 8; int j, k, l , m; j = a>b; k = a<b; l = a==b; m = a!=b; cout<<" \n Diketahui : \n"; cout<<" a > b : "<<j<<endl; cout<<" a < b : "<<k<<endl; cout<<" a == b : "<<l<<endl; cout<<" a != b : "<<m<<endl; c= a == b; cout<<" c : "<<c<<endl; cout<<" !c : "<<!c<<endl;
}
main()
{ int a, b, c; //inisialisasi variabel a = 2; b = 8; printf(" \n Diketahui : \n"); printf(" a > b : %d\n", a > b); printf(" a < b : %d\n", a < b); printf(" a == b : %d\n", a == b); printf(" a != b : %d\n", a != b); c= a == b; printf(" c : %d\n", c); printf(" !c : %d", !c);
getch();
}
main()
{ int x; float y; x = +5; y = -2.12; cout<<"\n Nilai x : "<<x; cout<<"\n Nilai y : "<<y<<endl; x=-x; //Merubah Nilai Menjadi Negatif y=-y; cout<<"\n Nilai x : "<<x; cout<<"\n Nilai y : "<<y<<endl; //Operasi increment, x = x + 1; x++; //Operasi decrement, y = y - 1; y--; cout<<"\n Nilai x : "<<x<<" y : "<<y;
main()
{ int x; float y; x = +5; y = -2.12; printf("\n Nilai x : %i",x); printf("\n Nilai y : %0.2f\n",y); x=-x; //Merubah Nilai Menjadi Negatif y=-y; printf("\n Nilai x : %i",x); printf("\n Nilai y : %0.2f\n",y); //Operasi increment, x = x + 1; x++; //Operasi decrement, y = y - 1; y--; printf("\n Nilai x : %i y : %.2f\n",x,y);
main()
{ int x =10, y = 3; int z, p; z = x + y; p = z - y; cout<<" Perhitungan Binary \n"; cout<<x<<" + "<<y<< " = "<<z<<endl; cout<<z<<" - "<<y<< " = "<<p<<endl;
getch();
}