wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C-Programming

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is a invalid variable name

a)

BASICSALARY

b)

BasicSalary

c)

1_basicsalary

d)

_basicsalary

2.

Point out the erroneous statements

a)

a+c = d

b)

a= 2+3

c)

a = 'c'+'d'

d)

a = b

3.

The maximum value that an integer constant can have is

a)

32767

b)

-32767

c)

1.7014e+38

d)

–1.7014e+38

4.

A character variable can never store more than

a)

32 characters

b)

18 characters

c)

2 characters

d)

1 character

5.

Which of the following is FALSE in C

a)

Keywords can be used as variable names

b)

Variable names can contain a digit

c)

Variable names do not contain a blank space

d)

Capital letters can be used in variable names

6.

In C, Arithmetic instruction cannot contain

a)

variables

b)

constants

c)

variable names on right side of =

d)

constants on left side of =

7.

C language has been developed by

a)

Ken Thompson

b)

Dennis Ritchie

c)

Peter Norton

d)

Martin Richards

8.

C programs are converted into machine language with the help of

a)

An Editor

b)

an IDE

c)

An operating system

d)

Compiler

9.

What of the following is not a correct way of defining a constant

a)

#define num 25

b)

const int A=10;

c)

#define num =25

d)

const float A=10

10.

Which of the following is not a correct for identifier

a)

it is a name given to various elements of the program

b)

an identifier can be in uppercase or lowercase

c)

it can use a special symbol _ (underscore)

d)

start of an identifier should always be with a digit

11.

scanf() function is an example of

a)

formatted output function

b)

keyword

c)

variable

d)

formatted input function

12.

Which of the following is not true for #include<stdio.h> header file

a)

It is called a preprocessor directive

b)

It is used to direct the processor to include the header file in the program

c)

it is used to perform calculations in a program

d)

it is a standard input output header file

13.

select the correct syntax to read a variable named num of type integer from user

a)

scanf("%d",num);

b)

scanf("%d",&num);

c)

scanf("%d,&num");

d)

scanf("%d,num");

14.

To display the value of a variable num of type integer, select the correct statement

a)

printf("The number is num");

b)

printf("The number is %d",&num);

c)

printf("The number is num,%d");

d)

printf("The number is %d",num);

15.

How many bytes are reserved in memory for integer variables in c-program(for 16-bit compiler)

a)

2

b)

4

c)

8

d)

1