#include<stdio.h>
void main()
{
int a=5,b=6,c;
int x=(a<b)+7;
int y=(x==7)*9;
int z=(c=x+y)*2;
printf("%h %h %h",x,y,z);
}
What is the output? Explain it.
Answer Posted / seema choudhary
output:
x=8
y=0
z=16
x=8 because (a<b) condition is true, it return 1 means non
zero, then 1+7=8
y=0 because (x==7) condition is false return 0. then 0*9=0
z=16 because x=8,y=0 then 8+0=8*2=16
| Is This Answer Correct ? | 12 Yes | 6 No |
Post New Answer View All Answers
Is swift based on c?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
What do you mean by c what are the main characteristics of c language?
Are the expressions * ptr ++ and ++ * ptr same?
Explain what is meant by 'bit masking'?
Why we use void main in c?
When is a “switch” statement preferable over an “if” statement?
What is the difference between arrays and pointers?
Why C language is a procedural language?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
Do you know the purpose of 'register' keyword?
What's the right way to use errno?
In a switch statement, what will happen if a break statement is omitted?
What the different types of arrays in c?
how logic is used