#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
Why C language is a procedural language?
How to explain the final year project as a fresher please answer with sample project
What is meant by inheritance?
What is pass by reference in functions?
What is the scope of static variables in c language?
What is the code in while loop that returns the output of given code?
what is the difference between 123 and 0123 in c?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Write a program to check palindrome number in c programming?
Is that possible to add pointers to each other?
What are the types of macro formats?
How can I find out if there are characters available for reading?
why we wont use '&' sing in aceesing the string using scanf
write a program to print data of 5 five students with structures?
What is malloc() function?