Monday 30 March 2015

contoh operasi Logika


# include <iostream.h>
# include <conio.h>

main()
{
int x=10,N1,N2;
clrscr();
cout <<"\nYour number = " <<x;
cout <<"\n\n";
cout <<"\n LOGICA AND";
cout <<"\n===========";
N1 = (x==10)&&(x==20);
cout <<"\n(x=10)&&(x=20) = " <<N1;
cout <<"\n\n";
cout <<"\n LOGICA OR";
cout <<"\n===========";
N2 = (x==10)||(x==20);
cout <<"\n(x=10)||(x=20) = " <<N2;
getch();

}





No comments:

Post a Comment