wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C Prog BCA 1st

Total questions: 65

Worksheet time: 50mins

Name
Class
Date
1.

1. What will be the output of the following C code?

a)

No Output

b)

TESTING

c)

Compiler error

d)

None of the above

2.

What will be the output of the C code?

a)

Hello World! x;

b)

Hello World! followed by a junk value

c)

Compile time error

d)

Hello World!

3.

The format identifier ‘%i’ is also used for _____ data type.

a)

char

b)

int

c)

float

d)

double

4.

What will be the output of the following C code?

a)

2

b)

8

c)

9

d)

10

5.

What will be the output of the following C code?

a)

3 2 3

b)

2 2 3

c)

3 2 2

d)

2 3 3

6.

What will be the output of the following C code?

a)

Run time error

b)

7

c)

8

d)

Depends on compiler

7.

Assuming, integer is 2 byte, What will be the output of the program?

a)

ffff

b)

0

c)

8fff

d)

Error

8.

Who is the father of C language?

a)

Steve Jobs

b)

James Gosling

c)

Dennis Ritchie

d)

Rasmus Lerdorf

9.

All keywords in C are in ____________

a)

LowerCase letters

b)

UpperCase letters

c)

CamelCase letters

d)

all of them

10.

Which keyword is used to prevent any changes in the variable within a C program?

a)

variable

b)

mutable

c)

constant

d)

extern

11.

What is #include <stdio.h>?

a)

Preprocessor directive

b)

Inclusion directive

c)

File inclusion directive

d)

None of the mentioned

12.

scanf() is a predefined function in______header file.

a)

stdlib. h

b)

conio.h

c)

stdio.h

d)

math.h

13.

what will be the output of the following code?

int main()

{

int y = 10000;

int y = 34;

printf("Hello World! %d\n", y);

return 0;

}

a)

Compile time error

b)

Hello World! 34

c)

Hello World! 1000

d)

Hello World! followed by a junk value

14.

format specifier for float data type is (a)  

15.

What will be the final value of x in the following C code?

#include <stdio.h>

void main()

{

int x = 5 * 9 / 3 + 9;

}

a)

3.74

b)

24

c)

25

d)

none of te above

16.

what is the right way to initialize the array?

a)

int num[6] = { 2, 4, 12, 5, 45, 5 };

b)

int n{} = { 2, 4, 12, 5, 45, 5 };

c)

int n{6} = { 2, 4, 12 };

d)

all of the above

17.

Which of the following correctly shows the hierarchy of arithmetic operations in C?

a)

/ + * -

b)

* - / +

c)

+ - / *

d)

/ * + -

18.

To print out 'a' as an integer and 'b' as a decimal, which of the following printf() statement will you use?

a)

printf("%f %lf", a, b)

b)

printf("%f %f", a, b)

c)

printf("%d %f", a, b)

d)

printf("%f %d", a, b)

19.

Which of the following is not logical operator?

a)

&

b)

&&

c)

||

d)

!

20.

When does the code block following while(x<100) execute?

a)

When x is less than one hundred

b)

When x is greater than one hundred

c)

When x is equal to one hundred

d)

while it wishes

21.

Input/output function prototypes and macros are defined in which header file?

a)

conio.h

b)

stdlib.h

c)

stdio.h

d)

dos.h

22.

Which of the following is not a correct variable type?

a)

int

b)

real

c)

float

d)

char

23.

Which of the following is the correct operator to compare two variables?

a)

equal

b)

=

c)

:=

d)

==

24.

What is the only function all C programs must contain?

a)

start()

b)

system()

c)

main()

d)

Program()

25.

What punctuation is used to signal the beginning and end of code blocks?

a)

{ }

b)

-> and <-

c)

BEGIN and END

d)

( and )

26.

The "\n" character does which of the following operations?

a)

Double line spacing

b)

Character deletion

c)

Character backspace

d)

Places cursor on the next line

27.

Is the syntax for the following C statement correct?:


scanf("%d", input);

a)

True

b)

False

28.

Which arithmetic operator in C returns the integer remainder of the result of dividing its first operand by its second?

a)

%

b)

/

c)

\

d)

*

29.

The compiler ignores comments and they are not translated into machine language.

a)

True

b)

False

30.

You can have more than one main function.

a)

True

b)

False

31.
How will you print \n on the screen?
a)
printf("\n");
b)
echo "\\n";
c)
printf('\n');
d)
printf("\\n");
32.
We want to round off x, a float, to an int value, The correct way to do is
a)
y = (int)(x + 0.5)
b)
y = int(x + 0.5)
c)
y = (int)x + 0.5
d)
y = (int)((int)x + 0.5)
33.

Which of the following are valid variable names in C?

a)

first_name

b)

123name

c)

_count

d)

#value

34.

Which of these are basic data types in C?

a)

int

b)

float

c)

char

d)

string

35.

Which are arithmetic operators in C?

a)

%

b)

/

c)

*

d)

+

e)

-

36.

Which header file is required for using printf function?

a)

#include<math.h>

b)

#include<conio.h>

c)

#include<stdio.h>

d)

#include<string.h>

37.

Which symbols are used for single line comments in C?

a)

//

b)

/* message */

c)

--

d)

#

38.

What is the purpose of scanf() function?

a)

Clear screen

b)

Exit program

c)

Read input

d)

Print output

39.

Which is the correct way to declare and initialize an integer variable?

a)

age=20

b)

var age=20

c)

integer age=20

d)

int age=20

40.

What are essential parts of a C program?

a)

Header files

b)

Main function

c)

Variables

d)

Classes

41.

Where is semicolon (;) required in C programs?

a)

Preprocessor directives

b)

End of statement

c)

Header inclusion

d)

Function declaration

42.

Which format specifier is used for integers in printf?

a)

%s

b)

%d

c)

%f

d)

%c

43.

How many bytes does a char data type occupy?

a)

2 bytes

b)

8 bytes

c)

4 bytes

d)

1 byte

44.

Which rules apply to C identifiers?

a)

Can start with number

b)

Can start with letter

c)

Can contain spaces

d)

Can use keywords

45.
a)

5 5

b)

5 10

c)

10 10

d)

10 5

46.
a)

24

b)

14

c)

20

d)

error

47.

printf("%d", -5 % 2);

a)

-1

b)

1

c)

-2

d)

Compiler dependent

48.

in which extension we need to save the program to run on c compiler.

a)

filename.cpp

b)

filename.c

c)

filename.jpeg

d)

filename.o

49.

What is the scope of a local variable?

a)

Within function

b)

Within file

c)

Entire program

d)

Within block

50.

Which is the format specifier for unsigned long int

a)

%ld

b)

%ul

c)

%lu

d)

%d

51.

The instructions that tell the computer what to do and how to do it:

a)

Hardware

b)

Software

c)

Input

d)

None of the above

52.

Using a specific system computer can convert numbers, letters, and symbols into combinations of ones and zeros. What is the name for this system?

a)

Conversion System

b)

Control System

c)

Binary System

d)

Bits and bytes system

53.

What are the four parts of the information processing cycle?

a)

Input, output, processing, and deleting

b)

Input, output, processing, and storage

c)

Input, output, processing, and printing

d)

None of the above

54.

There are two types of memory on the motherboard of a computer. One is known as RAM which stands for Random Access Memory. This is also known as what type of memory?

a)

Long term memory

b)

Short term memory

c)

Standard access memory

d)

ROM

55.

Which of the following tasks should be completed to help maintain your computer system?

a)

Start a notebook of information for your computer system

b)

Occasionally review disk directories and delete unnecessary files

c)

Back up files and data on a regular basis.

d)

All of the above

56.

Look at this series: 201, 202, 204, 207, ... What number should come next?

a)

205

b)

208

c)

210

d)

211

57.

Look at this series: 544, 509, 474, 439, ... What number should come next?

a)

404

b)

414

c)

420

d)

445

58.

9 16 23 30 37 44 51

a)

59 66

b)

56 62

c)

58 66

d)

58 65

e)

54 61

59.

In a certain code, HARYANA is written as 8197151, how is DELHI written in that code?

a)

45389

b)

57389

c)

89654

d)

12547

60.

If in a code language. COULD is written as BNTKC and MARGIN is written as LZQFHM, how will MOULDING be written in that code?

a)

CHMFINTK

b)

LNKTCHMF

c)

LNTKCHMF

d)

NITKHCMF

61.

In a certain code, MONKEY is written as XDJMNL. How is TIGER written in that code?

a)

QDFHS

b)

SDFHS

c)

SDFHS

d)

UJHFS

62.

Introducing a boy, a girl said, "He is the son of the daughter of the father of my uncle." How is the boy related to the girl?

a)

Brother

b)

Nephew

c)

Uncle

d)

Son-in-law

63.

Introducing Sonia, Aamir says, "She is the wife of only nephew of only brother of my mother." How Sonia is related to Aamir?

a)

Wife

b)

Sister

c)

Sister-in-law

d)

Data is inadequate

64.

Direction -

Five girls are sitting on a bench to be photographed. Seema is to the left of Rani and to the right of Bindu. Mary is to the right of Rani. Reeta is between Rani and Mary.

Q. Who is in the middle of the photograph ?

a)

Bindu

b)

Rani

c)

Reeta

d)

Seema

65.

Direction -

Five girls are sitting on a bench to be photographed. Seema is to the left of Rani and to the right of Bindu. Mary is to the right of Rani. Reeta is between Rani and Mary.

Q. Who is second from the left in photograph ?

a)

Reeta

b)

Mary

c)

Bindu

d)

Seema