1:
#include <stdio.h>
///***decrement operator:
int main()
{
int a,b;
a=7;
a--;
printf("%d\n",a);
--a;
printf("%d\n",a);
b=a--;
printf("%d %d\n",a,b);
b=--a;
printf("%d %d\n",a,b);
return 0;
}
output: 6
5
4 5
3 3
2:
#include <stdio.h>
///relation operator:
int main()
{
int a=5,b=6,condition;
condition=a>b; ///if-true=1,false=0
printf("%d",condition);
return 0;
}
///*** !=not equal
///*** c=a>=b---wrong--0
///*** c=a<=b---true--1
///*** c=a!=b---true--1
///***c=a==b---false-0
///*** a=b=c ---6
output: 0 ///***condition is wrong so ans is 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: 1
No comments:
Post a Comment