Open In App

Josh Technology Interview Experience | MCQ Online questions

Improve
Improve
Like Article
Like
Save
Share
Report

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”);
}

 


Last Updated : 04 Sep, 2019
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads