wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C_i_Quiz

Total questions: 12

Worksheet time: 5mins

Name
Class
Date
1.

What is the output of this code?

#include <stdio.h>

int main() {

int x = 5;

printf("%d", x++);

return 0;

}

a)

4

b)

6

c)

5

d)

Error

2.

What is the output of the following program?

#include <stdio.h>

int main() {

char c = 'A';

printf("%c", c+1);

return 0;

}

a)

A

b)

B

c)

66

d)

Compile Error

3.

C program execution begins from (a)   function.

4.
  1. Output of this snippet?

#include <stdio.h>

int main() {

int x = 1;

printf("%d %d %d", x, ++x, x++);

return 0;

}

a)

3 3 1

b)

1 3 3

c)

1 2 3

d)

Undefined Behavior

5.
  1. Output for this program?

  2. #include <stdio.h>

    int main() {

    char c = 'a';

    printf("%d", c);

    return 0;

    }

a)

97

b)

98

c)

65

d)

0

6.
  1. What is the output here?

  2. #include <stdio.h>

    int main() {

    int a = 5;

    int b = a++;

    printf("%d %d", a, b);

    return 0;

    }

a)

5 5

b)

5 6

c)

6 5

d)

Error

7.

Output of the code?

#include <stdio.h>

int main() {

int a = 17, b = 5;

printf("%d", a % b);

return 0;

}

a)

2

b)

3

c)

17

d)

5

8.

#include <stdio.h>

int main() {

double d = 10.123456;

printf("%.3lf", d);

return 0;

}

a)

10.123456

b)

10.12463

c)

10.124

d)

10.123

9.

#include <stdio.h>

int main() {

char ch = 'Z';

printf("%c", ch - 1);

return 0;

}

a)

Y

b)

Z

c)

X

d)

Error

10.

What will be the output of the following code?

#include <stdio.h>

int main() {

int num = 10;

printf("%d", ++num);

return 0;

}

a)

Error

b)

10

c)

9

d)

11

11.

What is the output of this program?

#include <stdio.h>

int main() {

float f = 5.5;

printf("%.1f", f * 2);

return 0;

}

a)

10.0

b)

11.0

c)

5.5

d)

10.5

12.

What will be the output of the following code?

#include <stdio.h>

int main() {

int x = 3, y = 4;

printf("%d", x * y + x);

return 0;

}

a)

12

b)

10

c)

15

d)

7