#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 context in c?
Why we use stdio h in c?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Why do we use stdio h and conio h?
What are the 5 organizational structures?
Can two or more operators such as and be combined in a single line of program code?
why we wont use '&' sing in aceesing the string using scanf
What are the different types of control structures?
What is 2c dna?
What is c token?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is c system32 taskhostw exe?
What are all different types of pointers in c?
What are valid signatures for the Main function?
What are shell structures used for?