#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 program flowchart?
What is the modulus operator?
What does c mean in standard form?
Is c easy to learn?
Explain what are run-time errors?
Explain the difference between exit() and _exit() function?
What are the three constants used in c?
Why do we use main function?
How can I sort a linked list?
What are pointers? What are stacks and queues?
Explain can you assign a different address to an array tag?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Should I learn data structures in c or python?
What is the correct declaration of main?