wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz on Basics of C

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

Select the wrong statement from the following

a)

Int Var_Name = 10 ;

b)

int _ = 10 ;

c)

int varName = 10;

d)

int Var_Name = 10;

2.

#include <stdio.h>

int main() {

int x = 3;

if (x = 0)

printf("Hello");

else

printf("World");

return 0;

}

Select the output of code

a)

Hello

b)

World

c)

Compiler Error

d)

Undefined behavior

3.

Select the correct statement from the following

a)

float Var_Name = 10.5 ;

b)

int 1stVar = 20 ;

c)

double varName = 15.0;

d)

char var-name = 'A';

4.

#include <stdio.h>

int main() {

int z = 10;

if (z != 10)

printf("False");

else

printf("True");

return 0;

}

Select the output of code

a)

Undefined behavior

b)

Compiler Error

c)

True

d)

False

5.

#include <stdio.h>

int main() {

int a = 5, b = 3;

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

return 0;

}

What will be the output of the code

a)

1

b)

3

c)

5

d)

2

6.

Select wrong keyword

a)

int

b)

char

c)

string

d)

double

7.

#include <stdio.h>

int main() {

int a = 6;

printf("%d", a >> 1);

return 0;

}

Select the correct output

a)

6

b)

2

c)

1

d)

3

8.

Decimal value of 1011

a)

10

b)

11

c)

12

d)

13

9.

#include <stdio.h>

int main() {

int a = 3, b = 4, c = 5;

printf("%d", a || b && c);

return 0;

}

Output of the code

a)

5

b)

0

c)

4

d)

1

10.

C Language is not a

a)

Procedural Language

b)

Middle level language

c)

Object oriented Language

d)

Functional language