#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
What are structural members?
With the help of using classes, write a program to add two numbers.
Are there any problems with performing mathematical operations on different variable types?
Is c high or low level?
Why c is called free form language?
What are the disadvantages of external storage class?
Explain output of printf("Hello World"-'A'+'B'); ?
Explain what is the advantage of a random access file?
How reliable are floating-point comparisons?
What is the purpose of sprintf() function?
What is atoi and atof in c?
What are local variables c?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Explain what are the advantages and disadvantages of a heap?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.