wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C Programming Concepts

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

Who developed the C language?

a)

Ken Thompson

b)

Bjarne Stroustrup

c)

Dennis Ritchie

d)

Kernighan

2.

C program should be written in

a)

Upper case

b)

Title case

c)

lower case

d)

none of these

3.

Every statement in a C program should end with a -------------

a)

Colon(:)

b)

semicolon(;)

c)

comma(,)

d)

fullstop(.)

4.

What is the result of 6%4 ?

a)

4

b)

3

c)

2

d)

1

5.

else is a --------------------------

a)

variable

b)

identifier

c)

datatype

d)

keyword

6.

The symbol of a new line character is -----------------------

a)

\n

b)

\t

c)

\d

d)

\f

7.

The Unary operator is -----------------------------

a)

>>

b)

++

c)

<<

d)

==

8.

Commonly used input function is --------------

a)

scanf()

b)

printf()

c)

getch()

d)

putch()

9.

1 GB is equal to ------------

a)

1024KB

b)

1024 Byte

c)

1024MB

d)

1024 nano

10.

%f specifies ---------------- data type

a)

float

b)

int

c)

char

d)

string

11.

Program needs to be converted into _________________ before running it

a)

Assembly code

b)

Vb.net code

c)

Low level code

d)

Machine code

12.

Commonly used output function is ------------

a)

printf()

b)

scanf()

c)

getch()

d)

none of these

13.

Compiler produces ________________ file

a)

dynamic

b)

executable

c)

static

d)

non executable

14.

What is the result after execution of the following code if a is 10, b is 5, and c is 10?

if ((a > b) && (a <= c))

a = a + 1;

else

c = c+1;

a)

a = 10, c = 10

b)

a = 11, c = 10

c)

a = 10, c = 11

d)

a = 11, c = 11

15.

What type of data would your name be?

a)

Real

b)

Boolean

c)

Integer

d)

String

16.

What type of data would the letter 'K' be?

a)

Boolean

b)

String

c)

Character

d)

Real

17.

Which of the following is a relational operator?

a)

+

b)

-

c)

/

d)

>

18.

What will be the output of the following C code?

a)

Run time error

b)

7

c)

8

d)

Depends on compiler

19.

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int x = 5;

if (x < 1)

printf("hello");

if (x == 5)

printf("hi");

else

printf("no");

}

a)

hi

b)

hello

c)

no

d)

error

20.

which is the only function all C programs must contain?

a)

start()

b)

sys()

c)

main()

d)

scanf()

21.

How many bits are allocated for int data type

a)

16

b)

8

c)

2

d)

1

22.

Every C program requires

a)

header file

b)

main function

c)

data declaration

d)

All

23.

%s indicates in scanf statement

a)

to get an integer

b)

to get a character

c)

to get a string

d)

to get a real no.

24.

Which of the following is not a correct variable type?

a)

float

b)

real

c)

int

d)

char

25.
What punctuation is used to indicate the beginning and end of code blocks?
a)
{ }
b)
-> <-
c)
BEGIN and END
d)
( and )