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?


Answers were Sorted based on User's Feedback



main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / pandu

x=8,y=6

Is This Answer Correct ?    20 Yes 3 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / rajesh

Error will be occur because the variable declaration
does`t intilized terminate symbol(;), and again same
mistake in line 5 and line 6.

Is This Answer Correct ?    7 Yes 0 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / ganesh bankar

There is a errsor at compile time because some statements
are not terminated by ";".

Is This Answer Correct ?    5 Yes 0 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / 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

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / kirthi s

x=2.y=4

Is This Answer Correct ?    2 Yes 14 No

Post New Answer

More C Interview Questions

What does %p mean c?

0 Answers  


Is multithreading possible in c?

0 Answers  


Why is c platform dependent?

0 Answers  


What is static and volatile in c?

0 Answers  


what type of errors are checked during compilation

3 Answers  


What is meant by errors and debugging?

0 Answers  


if we take a number as a char then can we manipulate(add, subtract) on this number

2 Answers  


how to add two numbers without using arithmetic operators?

4 Answers  


Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +

1 Answers  


What is meaning of "Void main" in C Language.

24 Answers   Ford, GU, HCL, IBIBS, JUW, TCS,


Is calloc better than malloc?

0 Answers  


Tell me what is null pointer in c?

0 Answers  


Categories