#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 is the correct code to have following output in c using nested for loop?
Give basis knowledge of web designing ...
regarding pointers concept
Who developed c language?
What is the general form of a C program?
Explain the difference between strcpy() and memcpy() function?
What is the use of printf() and scanf() functions?
Disadvantages of C language.
Why are all header files not declared in every c program?
How can I discover how many arguments a function was actually called with?
What does c mean in standard form?
What does node * mean?
provide an example of the Group by clause, when would you use this clause
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is a macro?