Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Basic Data Types & Operators

Total questions: 48

Worksheet time: 2hrs 45mins

Name
Class
Date
1.
Examples of hardware include web browsers, games, and word processors.
a)
True
b)
False
2.

Who is know as founder of C language

a)

Dennis Ritchie

b)

Bjarne Stroustroup

c)

Tim Berner Lee

d)

Rasmus Ledorf

3.

C is a

a)

Low level language

b)

Assembly language

c)

Medium level language

d)

High level language

4.

Which punctuation ends most of the lines of C code?

a)

.

b)

;

c)

,

d)

" "

5.

The starting point of C execution at

a)

==

b)

main()

c)

function()

d)

!=

6.

What do you think is the best way to enhance your skill in programming

a)

Study Hard

b)

Practice

c)

Practice and learn new

d)

Study one day and leave it

7.

Prewritten packages are imported to program by using which symbol

Hint: Header Files

a)

%

b)

-

c)

#

d)

//

8.

Find if the condition is True or False where int x=10; y=12;

x < y

a)

1 (True)

b)

0 (False)

9.

What do you think is the output for the below code snippet?

int main(){

int a=10,b=20;

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

}

a)

Error

b)

0.2

c)

2

d)

30

10.

What do you need to import stdio.h a header file?

a)

Just a waste of time

b)

To run the code

c)

It helps in compilation to binary coded file

d)

To perform input and output operations

11.

printf is a

a)

function

b)

variable

c)

datatype

d)

operator

12.

#include <stdio.h>

int main()

{

int a = 2;

int b=11 ;

printf("%d\n", a+b*a);

}

a)

26

b)

24

c)

20

d)

None

13.

#include <stdio.h>

int main()

{

int a = 10, b = 5, c = 5;

int d;

d = b + a % c;

printf("%d", d);

}

a)

7

b)

5

c)

0

d)

Compile time error

14.

format specifier of a float number is

a)

%c

b)

%d

c)

%f

d)

%x

15.

int main ()


{


int x = 24, y = 39, z = 45;


z = x + y;


y = z - y;


x = z - y;


printf ("n%d %d %d", x, y, z);


}

a)

24 39 63

b)

39 24 63

c)

24 39 45

d)

39 24 45

16.

C Language is developed at ___________?

a)

AT & T's Bell Laboratories of USA in 1972

b)

AT & T's Bell Laboratories of USA in 1970

c)

Sun Microsystems in 1973

d)

Cambridge University in 1972

17.

C programs are converted into machine language with the help of

a)

An Editor

b)

A compiler

c)

An operating system

d)

None of these.

18.

Which one of the following is not a valid identifier?

a)

_examveda

b)

1examveda

c)

exam_veda

d)

examveda1

19.

Which is the only function all C programs must contain?

a)

start()

b)

system()

c)

printf()

d)

main()

20.
What punctuation is used to indicate the beginning and end of code blocks?
a)
{ }
b)
-> <-
c)
BEGIN and END
d)
( and )
21.
How to comment in C language?
a)
//Comment
b)
A & B
c)
* Comment *
d)
<---Comment---->
22.

Program is a list of_______________, written in a _______________________ to determines the behaviour of a machine.

a)

word, english

b)

instructions , programming language

c)

instructions, word

23.

A flowchart is a graphical representation that helps programmer to develop algorithms in programming.

a)

True

b)

False

24.

#include<stdio.h> is important line in c. The stdio.h contains information on input output routines.

a)

True

b)

False

25.

___ is used to translate source code instructions into the appropriate machine language instructions

a)

Module

b)

Library routine

c)

Compiler

d)

Preprocessor directives

26.

A ____ is a set of instructions that the computer follows to solve a problem.

a)

Comipler

b)

Linker

c)

Program

d)

Operator

27.

The program written by the programmer with high level language is called:

a)

Object Code

b)

Syntax

c)

Source Code

d)

Runtime Library

28.

What is the extension of C program source code?

a)

.cpp

b)

.py

c)

.c

d)

.java

29.

What is machine language?

a)

A language used by car

b)

Machine language is made of 1's and 0's

c)

Machine language is made of 7's and 8's

d)

A language that only understands plain English

30.

Which of the following is not a high level programming language?

a)

Assembly

b)

C++

c)

Java

d)

Python

31.

The words if, else, auto, float etc. have predefined meaning and users cannot use them as variables.


These words are called

a)

keywords

b)

identifier

c)

data types

d)

constant

32.

C language is a

a)

structured program

b)

object oriented program

c)

oriented program

d)

basic program

33.

What function is use to display a message?

a)

printf

b)

print

c)

output

34.

Symbolic constants are defined in (a)   section.

35.

All variables used in the program are declared in (a)   part of main function.

36.

user defined functions are contained in (a)   section.

37.

int main()

{

int a = 25%10;

printf("%d", a);


return 0;

}

a)

5

b)

2

c)

2.5

d)

5.5

38.

#include <stdio.h>


void main()

{


int x = 5 * 9 / 3 + 9;


}

a)

24

b)

3

c)

23

d)

4

39.

What is the output of the following printf


printf("%d",34+24/12%3*5/2-4);

a)

35

b)

-2

c)

34

d)

38

40.

What is the output of the following printf:


printf("%d",14%-4);

a)

2

b)

-2

c)

3

d)

0

41.

What is the output of the following printf:


int a=1,2,3,4;

printf("%d",a);

a)

1

b)

2

c)

3

d)

4

e)

Compile time error

42.

What is the value of X in the sample code given below?

X = ( 2 + 3) * 2 + 3;

a)

10

b)

13

c)

25

d)

28

43.

A name having a few letters,numbers and special character _(underscore) is called

a)

Keywords

b)

reserved words

c)

Identifier

d)

None of the above

44.

99%9

a)

0

b)

1

c)

10

d)

15

45.

10/3%2

a)

2

b)

1.56

c)

10

d)

1

46.

15/(3+4)*8

a)

37

b)

16

c)

0

d)

72

47.

5-10+3

which operation will be performed first?

a)

addition

b)

subtraction

48.

Operator % in C Language is called.?

a)

Percentage Operator

b)

Quotient Operator

c)

Modulus

d)

Division