#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


Please Help Members By Posting Answers For Below Questions

Where is c used?

659


What is the use of c language in real life?

539


What is the purpose of 'register' keyword?

697


Is c object oriented?

547


What is local and global variable in c?

626






What is the collection of communication lines and routers called?

619


How do you list files in a directory?

572


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

1606


Which header file should you include if you are to develop a function which can accept variable number of arguments?

818


How can I insert or delete a line (or record) in the middle of a file?

580


What is the use of in c?

586


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.

14983


What do you mean by dynamic memory allocation in c?

657


What standard functions are available to manipulate strings?

571


What are pointers in C? Give an example where to illustrate their significance.

757