main() {
int x=2, y=4
if ((x==2||y==4)
x++
y++
if (y==4+1)
{
x=x+y;
}
y++;
printf("The values of x and y are %d and %d."x,y);
}
What is the output?
Answer Posted / moolshankershukla
if use terminator after x++ and y++ and y=4 and ) missing
and {} missing then out put is
x=8 and y=6.
correct answer like this :
main ()
{
int x=2, y=4;
if ((x==2||y==4))
{
x++;
y++;
}
if (y==4+1)
{
x=x+y;
}
y++;
printf("The values of x and y are %d and %d."x,y);
}
out put is
x=8 and y=6.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is 'bus error'?
Are the expressions * ptr ++ and ++ * ptr same?
why do some people write if(0 == x) instead of if(x == 0)?
What are the types of pointers in c?
What is a pointer value and address in c?
How can you increase the size of a dynamically allocated array?
Is a pointer a kind of array?
Write a program to print ASCII code for a given digit.
How do shell structures work?
Difference between exit() and _exit() function?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What are structure types in C?
How arrays can be passed to a user defined function
What does the format %10.2 mean when included in a printf statement?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above