#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
how many key words availabel in c a) 28 b) 31 c) 32
What are global variables and explain how do you declare them?
Explain what are reserved words?
How can I invoke another program or command and trap its output?
Can include files be nested? How many levels deep can include files be nested?
What is the purpose of main( ) in c language?
how could explain about job profile
What is #line used for?
Explain what is a static function?
Write a simple code fragment that will check if a number is positive or negative.
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
How do you construct an increment statement or decrement statement in C?
Was 2000 a leap year?
What is the explanation for the dangling pointer in c?