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

consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is

4 Answers   TCS,


Why do some versions of toupper act strangely if given an upper-case letter?

0 Answers  


Why c is procedure oriented?

0 Answers  


What is the difference between realloc() and free()

1 Answers  


Explain function pointer with exapmles.

2 Answers  






3. When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these

0 Answers   Accenture,


Why is c still so popular?

0 Answers  


write a program to print %d ?

12 Answers  


What is linear search?

0 Answers  


When do we get logical errors?

0 Answers  


Write a program to add a given duration with time(24hrs format)

1 Answers   Protech,


Can anyone tell what is stack overflow? what precaution we should take?

1 Answers  


Categories