#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
What is a double c?
What is the stack in c?
Can I initialize unions?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Difference between pass by reference and pass by value?
What is volatile, register definition in C
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
Which header file is essential for using strcmp function?
What are header files and explain what are its uses in c programming?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is the purpose of void pointer?
What is data structure in c programming?
What is the use of gets and puts?
How can I read in an object file and jump to locations in it?