retagged by
920 views
0 votes
0 votes

What is the output of the following code snippet?

#include<stdio.h>
int main ( )
{
int x = 2, y = 5;
if (x < y)
   return (x = x+y);
else
   printf (“ GO Mock 1  ”);
   printf(“ Welcome to GO Mock test ”);
}
  1. GO Mock 1
  2. Welcome to GO Mock Test
  3. No output
  4. GO Mock 1Welcome to GO Mock Test
retagged by

1 Answer

Best answer
3 votes
3 votes
There is no compilation error but there will no output because function is returning a value and if statement is true in this case.
selected by
Answer:

Related questions

5 votes
5 votes
3 answers
1
Bikram asked Jan 16, 2017
975 views
What is the output of the following program?main( ){int i=4, z=12;if( i=5 || z 50)printf(“ Gate2017”);elseprintf(“ Gateoverflow”);}Gate2017Gateoverflowsyntax err...
1 votes
1 votes
1 answer
2