Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

BASIC C PROGRAMMING QUIZ

Total questions: 15

Worksheet time: 4mins

Name
Class
Date
1.

Who invented C programming language ?

a)

Ken Thompson

b)

James Gosling

c)

Dennis Ritchie

d)

James Thompson

2.

In C, program execution always starts from ________

a)

int a = 30

b)

#include<stdio.h>

c)

main()

d)

#include<conio.h>

3.

Which of the following are Relational Operators in C?

a)

=

b)

>=

c)

!=

d)

||

4.

In C, what is the correct hierarchy of arithmetic operations?

a)

*/ + -

b)

* +- /

c)

/ *+ -

d)

+ - / *

5.

Which one of the following is correct variable declaration?

a)

coding13

b)

13coding

c)

_CoDiNg_ChAlLeNgE

d)

coding.challenge

6.

Which loop can be used in C language so that the loop gets executed atleast once?

a)

while

b)

for

c)

switch

d)

do while

7.

int a = 1;

int b = 18;

a++;

b--;

what is the value of a and b?

a)

a=2

b=19

b)

a=2

b=17

c)

a=1

b=17

d)

a=1

b=19

8.

How many times the loop will get executed?

for(int i=5;i<=10;i++)

a)

5

b)

6

c)

4

d)

0

9.

Which is the correct form of Array Declaration?

a)

int a = {1,2,3}

b)

int a[];

c)

int a[]=[1,2,3];

d)

int a = {a,b,c};

10.

which is the correct format specifier for int ?

a)

%c

b)

%i

c)

%d

d)

%int

11.

char s[ ]= "civil engineering association";

printf("%d",strlen(s));

a)

28

b)

29

c)

27

d)

Cannot be determined

12.

int a=20;

a%=20;

what is the value of a?

a)

20

b)

1

c)

0

d)

None of the above

13.

A default statement is optional in SWITCH CASE.

true or false?

a)

TRUE

b)

FALSE

14.

Which is the right order

a)

int > char > float

b)

char < int < double

c)

char > int > float

d)

double < char < int

15.

What is the output of the below program?

#include<stdio.h>

main()

{

printf("\");

}

a)

\

b)

\"

c)

"

d)

Compile error