wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Programming Concepts Quiz

Total questions: 55

Worksheet time: 28mins

Name
Class
Date
1.

The first step in problem-solving using programming is:

a)

Coding

b)

Debugging

c)

Algorithm design

d)

Problem definition

2.

A program written in high-level language must be translated to:

a)

Binary numbers

b)

Source code

c)

Assembly language

d)

Object-oriented code

3.

Which representation uses symbols like ovals, diamonds, and rectangles?

a)

Algorithm

b)

Flowchart

c)

Pseudocode

d)

Source code

4.

The SDLC phase that identifies user needs is:

a)

Implementation

b)

Requirement analysis

c)

Testing

d)

Maintenance

5.

Debugging refers to:

a)

Writing algorithms

b)

Detecting and fixing errors

c)

Translating program

d)

Documentation

6.

Which approach breaks problems into sub-problems?

a)

Bottom-up

b)

Modular approach

c)

Top-down

d)

Sequential

7.

Example of an imperative language:

a)

Python

b)

Prolog

c)

HTML

d)

LISP

8.

In program development, testing ensures:

a)

Syntax correctness

b)

Logical correctness

c)

Machine translation

d)

Variable declarations

9.

Semantic errors occur when:

a)

Grammar rules are broken

b)

Meaning of program is wrong

c)

Compiler cannot parse

d)

Input/output is mismatched

10.

Which is NOT a program development step?

a)

Algorithm design

b)

Flowcharting

c)

Code encryption

d)

Testing

11.

The correct syntax for printing in C is:

a)

print("Hello");

b)

printf("Hello");

c)

cout<<"Hello";

d)

echo("Hello");

12.

The function used for input in C is:

a)

scanf()

b)

input()

c)

read()

d)

cin>>

13.

Which header file is required for printf and scanf?

a)

math.h

b)

conio.h

c)

stdio.h

d)

string.h

14.

In C, the first line executed is inside:

a)

start()

b)

main()

c)

init()

d)

header()

15.

Which symbol is used for format specifier in printf?

a)

#

b)

%

c)

&

d)

$

16.

Syntax error in C is detected at:

a)

Compilation

b)

Execution

c)

Testing

d)

Maintenance

17.

Which escape sequence prints a new line?

a)

\t

b)

\n

c)

\r

d)

\b

18.

To read a character input in C, you use:

a)

getchar()

b)

scanf("%s")

c)

cin>>

d)

gets()

19.

Which error is hardest to detect?

a)

Syntax error

b)

Semantic error

c)

Logical error

d)

Runtime error

20.

Which function is used to clear output screen in C (Turbo C)?

a)

cls()

b)

system("clear")

c)

clrscr()

d)

reset()

21.

Which is not a basic data type in C?

a)

int

b)

char

c)

float

d)

string

22.

The size of an int in most modern systems is:

a)

2 bytes

b)

4 bytes

c)

8 bytes

d)

1 byte

23.

A variable name in C cannot start with:

a)

Alphabet

b)

Underscore

c)

Number

d)

Lowercase letter

24.

Which operator has highest precedence?

a)

*

b)

()

c)

++

d)

%

25.

The modulus operator (%) works only with:

a)

float

b)

char

c)

int

d)

double

26.

User-defined data type is created using:

a)

typedef

b)

define

c)

macro

d)

include

27.

An array is a:

a)

Derived data type

b)

User-defined type

c)

Pointer

d)

Operator

28.

The operator used for logical AND is:

a)

&

b)

&&

c)

and

d)

*

29.

The increment operator increases value by:

a)

1

b)

2

c)

0

d)

10

30.

Expression evaluated first in a+b*c:

a)

a+b

b)

bc

c)

a+c

d)

all left-to-right

31.

If-else is an example of:

a)

Looping

b)

Branching

c)

Jumping

d)

Function call

32.

Which loop checks condition at the end?

a)

for

b)

while

c)

do-while

d)

switch

33.

In a for loop, the update expression is executed:

a)

Before condition

b)

After condition

c)

After each iteration

d)

Only once

34.

A loop inside another loop is called:

a)

Nested loop

b)

Infinite loop

c)

Recursive loop

d)

Do loop

35.

Which statement transfers control unconditionally?

a)

break

b)

continue

c)

goto

d)

return

36.

The switch statement works with:

a)

int, char

b)

float, double

c)

string

d)

all data types

37.

Break statement terminates:

a)

Only inner loop/switch

b)

Entire program

c)

All loops

d)

Compiler

38.

Which statement skips remaining statements in loop iteration?

a)

goto

b)

return

c)

continue

d)

break

39.

An infinite loop occurs when:

a)

Loop never executes

b)

Condition is always false

c)

Condition is always true

d)

No initialization

40.

A decision-making structure is:

a)

for loop

b)

while loop

c)

if-else

d)

array

41.

Which operator is used for conditional expression?

a)

&&

b)

?:

c)

||

d)

%

42.

Which data type is best to store true/false?

a)

int

b)

char

c)

bool

d)

float

43.

Which is not a loop in C?

a)

for

b)

while

c)

repeat-until

d)

do-while

44.

Which phase ensures program meets requirements?

a)

Coding

b)

Testing

c)

Analysis

d)

Maintenance

45.

Variable declared inside a function is:

a)

Global

b)

Static

c)

Local

d)

External

46.

Operator used to access address of a variable:

a)

*

b)

#

c)

&

d)

%

47.

Data type used for single character:

a)

int

b)

float

c)

char

d)

string

48.

Which error stops program from compilation?

a)

Syntax

b)

Logical

c)

Semantic

d)

Runtime

49.

Which of these is NOT part of SDLC?

a)

Coding

b)

Analysis

c)

Compilation

d)

Design

50.

A program that produces wrong results but runs successfully has:

a)

Syntax error

b)

Logical error

c)

Runtime error

d)

Semantic error

51.

Identify the error in the following C statement: printf("Welcome to C Programming);

a)

No error

b)

Missing semicolon

c)

Missing closing double quote

d)

Wrong function name

52.

Which of the following is a semantic error?

a)

Missing semicolon after a statement

b)

Using undeclared variable

c)

Adding an int and a char correctly but meaning is wrong

d)

Unmatched braces { }

53.

Choose the correct syntax for reading an integer in C:

a)

scanf("%d", x);

b)

scanf("%d", &x);

c)

scanf("%d", *x);

d)

scanf("%d", #x);

54.

What does the & symbol in C represent when used with a variable?

a)

Multiplication

b)

Address of variable

c)

Bitwise AND

d)

Dereferencing a pointer

55.

Find the error in the following code snippet: int main() { int a; scanf("%d", a); printf("%d", a); return 0; }

a)

No error

b)

scanf missing & before variable

c)

printf format specifier is wrong

d)

main should not return 0