#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


Please Help Members By Posting Answers For Below Questions

Why C language is a procedural language?

612


How to explain the final year project as a fresher please answer with sample project

459


What is meant by inheritance?

622


What is pass by reference in functions?

315


What is the scope of static variables in c language?

622






What is the code in while loop that returns the output of given code?

1286


what is the difference between 123 and 0123 in c?

710


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

714


Write a program to check palindrome number in c programming?

591


Is that possible to add pointers to each other?

888


What are the types of macro formats?

596


How can I find out if there are characters available for reading?

633


why we wont use '&' sing in aceesing the string using scanf

1773


write a program to print data of 5 five students with structures?

1598


What is malloc() function?

628