Evaluate the following expressions:
a. N+= N++ + ++N ;
System.out.println(N); ( if N is 12 initially)
b. int x=4,y;
y= (x++ )+( --x )+ x++;
System.out.println(y);
c. System.out.println( a*(++b )%c); if a=2,b=7,c=4
d. a+=b++ %7 + b++ + ++b - --c /5
System.out.println(a); (if a=2, b=4,c=8)
Answers
Answered by
1
Answer:
#include<stdio.h>
int main()
{
int x = 10;
float y = 10.0;
if (x == y)
printf("x and y are equal");
else
printf("x and y are not equal");
}
Explanation:
x and y are equal
Description : if (x == y) here we are comparing if (10 == 10.0) hence this condition is satisfied. Because we cannot compare int
and float so the int is converted to float and then compared. Hence it prints “x and y are equal”.
Similar questions