Josh Technology Interview Experience | MCQ Online questions

Round 1:

1.What is the output of the following code?

#include <stdio.h>



int main()
{
int x=5;
if(x==5){
if(x==5)break;
printf(“Hello”);
}
printf(“Hi”);
}

2.

What is the output of the following code?

#include <stdio.h>

int main()
{
int x=1, 2, 3;
printf(“%d”, i);
}

3.What is the output of the following code?

#include <stdio.h>

int main()
{
char s1[7]=”1234″, *p;
p=s1+3;
*p=’6′;
p=p-2;
*p=’8′;
printf(“%s”, s1);

}

4.What is the output of the following code?


#include <stdio.h>

int main()
{
int a=10, b=5, c=5;
int d;
d=b+c==a;
printf(“%d”, d);
}

5.What is the output of the following code?

#include <stdio.h>

int main()
{
char*p;
p=”hello”;
printf(“%c”, *&*p);
}

6. What is the output of the following code?

#include <stdio.h>

int main()
{
if(printf(“Hello”))
printf(“hi”);
else{
printf(“condition failed”);
}
}

7.What is the output of the following code?

#include <stdio.h>
#define int n= printf(“COMPANY”);
int main()
{
int n=10;
printf(“%d”, n);
}

8.What is the output of the following code?

#include <stdio.h>
int main()
{
int m, i=0, j=1, k=2;
m=i++||j++||k++;
printf(“%d %d %d %d”, m, i, j, k);
}

9.What is the output of the following code?

#include <stdio.h>
int main()
{
1|printf(“%d”, 10?0?5:1:12);
}

10.What is the output of the following code?

#include <stdio.h>
int main()
{
int i=0;
if(i==0){
i=(15, (i-3), 13, i++, i*10);
printf(i);
}
else
printf(“equal”);
}

 

Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.