Tuesday, December 30, 2014

operator(4)

1:
#include <stdio.h>
///logical operator:

int main()
{
int ssc,hsc,prove;
ssc=5;hsc=5;
prove=(ssc==5 || hsc==6);
printf("%d",prove);
return 0;

}

output: 1

2:
#include <stdio.h>
///logical operator:

int main()
{
int ssc,hsc,prove;
ssc=5;hsc=5;
prove=!(ssc==5);
printf("%d",prove);
return 0;

}
 

output: 0

3:
#include <stdio.h>
///logical operator:

int main()
{
int ssc,hsc,prove;
ssc=5;hsc=5;
prove=!(ssc==5,hsc==5);
printf("%d",prove);
return 0;

}
 

output: 0

4:
#include <stdio.h>
///logical operator:

int main()
{
int ssc,hsc,prove;
ssc=5;hsc=5;
prove=(ssc==5 && hsc==5);
printf("%d",prove);
return 0;

}

output:1

5:
#include <stdio.h>
///logical operator:

int main()
{
int ssc,hsc,prove;
ssc=5;hsc=5;
prove=(ssc==5 || hsc==6);
printf("%d",prove);
return 0;

}

output: 1

/***condition true=1
/***condition false=0





No comments:

Post a Comment