#include<conio.h>
#include<stdio.h>
void main()
{
int i;
if(1,0,2,3)
{
printf("if");
}
else
{
printf("else");
}
getch();
}
Can any body tell the answer of this question with explanation?
Answer Posted / shyamkumar1221
the question might be like this
#include<conio.h>
#include<stdio.h>
void main()
{
int i=1;
intj=0,k=2,l=3;
if(i,j,k,l)
{
printf("if");
}
else
{
printf("else");
}
getch();
}
the output would be if
since in the if ()we are using comma operator.the precedence
is left to right...since in the if the we get output as 3
which is non zero.the if statement is true and if statement
will be printed
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
Where is c used?
What is the use of c language in real life?
What is the purpose of 'register' keyword?
Is c object oriented?
What is local and global variable in c?
What is the collection of communication lines and routers called?
How do you list files in a directory?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Which header file should you include if you are to develop a function which can accept variable number of arguments?
How can I insert or delete a line (or record) in the middle of a file?
What is the use of in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What do you mean by dynamic memory allocation in c?
What standard functions are available to manipulate strings?
What are pointers in C? Give an example where to illustrate their significance.