#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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / guest
yhaa... it will print if....... okay...
why u know.... because in if condition u r not checking any
conditions... thatis why,,,,,
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / prateek songara
By default "i" will posses the value 2 bcoz of "int" and when it moves to "if" it will check all the values matches with its value (1,0,2,3) and if he gets the match then it will print the "if" ..else it will print the "else"..........hope you got the answer now.
| Is This Answer Correct ? | 1 Yes | 4 No |
how to implement stack work as a queue?
send me the code of flow chart generator using C-programming language amd this code should calculate the time and space complexity of the given progran and able to generate flowchart according to the given program?
write a c programme for add of two numbers with out use of arthematic operators
What is the sizeof () operator?
Is c is a low level language?
What is new line escape sequence?
Is it valid to address one element beyond the end of an array?
what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }
What are valid signatures for the Main function?
Can I pass constant values to functions which accept structure arguments?
Explain the difference between strcpy() and memcpy() function?
what type of language is C?