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

how to implement stack operation using singly linked list

2 Answers  


write a C and C++ programme to implement the A,bubble sort B,quick sort C,insertion sort D,sequential search E,binary search

1 Answers   ADP, TCS,


write a statement to display all the elements array M(in reverse order? int M[8]={20,21,22,23,24,25,26,27};

5 Answers  


Why is c called a structured programming language?

1 Answers  


How can I convert integers to binary or hexadecimal?

2 Answers  


write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC

2 Answers   HCL,


? ???Mirror Mirror on the wall????????

1 Answers   channel V, DPI,


What is the use of the restrict keyword?

1 Answers  


Which is the best sort method for library management?

1 Answers   Microsoft,


can anyone please tell about the nested interrupts?

1 Answers  


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1 Answers  


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1 Answers   TISL,


Categories