Online C Language Quiz

1. What is the output of the following code?
#include <stdio.h>
main()

{
enum { Ujjain, is=7, GREAT };
printf("%d %d", Ujjain, GREAT);
}

2. What is the output of the following code?
#include<stdio.h>
main()
{
float const pi = 3.14;
pi++;
printf("%f",pi);
}

3. What is the output of the following code?
#include<stdio.h>
main()
{
char x = '5';
if(x == '5')
{
if(x == '5') break;
printf("Hello");
}
printf("Hi");
}

4. What is the output of the following code?
#include<stdio.h>
main()
{
int a = 1;
float b = 1.5;
double c;
c = a + b;
printf("%lf", c
); }

5.What is the output of the below code snippet?
#include<stdio.h>
main()
{
char a = '0', b = '1', c = '2';
printf("%c %c", a, b, c);
}

6.What is the output of the below code snippet?
#include<stdio.h>
main()
{
char s[]="Ujjain", t[]="Ujjain";
if(s==t) printf("eqaul");
else printf("unequal");
}

7. What is the output of the below code?
#include<stdio.h>
main()
{
for(;;)printf("Bhilai");
}

8. What is the output of the following program?
#include<stdio.h>
void f()
{
static int i=10;
++i;
printf("%d", i);
}
main()
{
f();
f();
f();
}

9. What is the output of the following code snippet?
#include<stdio.h>
main()
{
int *p = 1500;
printf("%d",*p);
}

10. What is the output of the following program?
#include<stdio.h>
void f()
{
printf("RamRam\n");
}
main()
{
;
}


Show me the answers!

Question 1: The correct answer is the 0 8.

Question 2: The correct answer is Compiler Error.

Question 3: The correct answer is Compiler Error.

Question 4: The correct answer is 2.500000.

Question 5: The correct answer is 0 1.

Question 6: The correct answer is unequal.

Question 7: The correct answer is Infinite loop.

Question 8: The correct answer is 111213.

Question 9: The correct answer is Compiler Error.

Question 10: The correct answer is No Output.

You answered them all right!



InfoSTA Software @copy 2017 vedveethi.co.in - All Rights Reserved.