wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Introduction to C Programming

Total questions: 31

Worksheet time: 50mins

Name
Class
Date
1.

What is a program?

a)

A set of instructions executed by the hardware

b)

A type of hardware component

c)

A document explaining a software design

d)

A set of network protocols

2.

Programming is the process of:

a)

Writing, testing, and maintaining computer programs

b)

Repairing hardware components

c)

Managing computer networks

d)

Using a word processor

3.

Which language translator converts the entire source code into machine code before execution?

a)

Interpreter

b)

Compiler

c)

Assembler

d)

Linker

4.

An interpreter:

a)

Converts high-level code to machine code all at once

b)

Translates and executes code line by line

c)

Combines object files

d)

Loads programs into memory

5.

What is the role of an editor in programming?

a)

Debugging errors in code

b)

Writing and modifying source code

c)

Converting code into machine language

d)

Allocating memory for execution

6.

A linker:

a)

Loads programs into memory

b)

Combines multiple object files

c)

Edits source code

d)

Executes machine code

7.

What does a loader do?

a)

Links multiple programs

b)

Loads machine code into memory

c)

Compiles source code

d)

Edits a program

8.

Which programming paradigm treats functions as first-class citizens?

a)

Object-Oriented Programming

b)

Functional Programming

c)

Modular Programming

d)

Structural Programming

9.

Object-oriented programming is based on:

a)

Functions

b)

Modules

c)

Objects and classes

d)

Algorithms

10.

Modular programming focuses on:

a)

Writing code as a single monolithic block

b)

Dividing code into independent modules

c)

Using only procedural constructs

d)

Ignoring data structures

11.

What is program design?

a)

The process of testing software

b)

The creation of algorithms before coding

c)

The debugging of source code

d)

The execution of a program

12.

A top-down design approach:

a)

Starts with the details and moves to the main structure

b)

Focuses on implementing small modules first

c)

Breaks down the system from high-level to detailed components

d)

Uses only one function to control execution

13.

Which of the following is a program design tool?

a)

Flowchart

b)

Pseudocode

c)

Decision tree

d)

All of the above

14.

A high-level language:

a)

Uses machine-level instructions

b)

Is closer to human language

c)

Requires an assembler

d)

Only works with hardware-level instructions

15.

A low-level language is:

a)

Machine-dependent

b)

Easy to debug

c)

Similar to English

d)

Platform-independent

16.

What is a 4GL (Fourth-Generation Language)?

a)

A type of low-level programming language

b)

A language designed for specific applications like databases

c)

A hardware description language

d)

A type of object-oriented language

17.

What is a characteristic of C?

a)

Platform-dependent

b)

Object-oriented

c)

Slow execution

d)

Does not support pointers

18.

Which of the following is a preprocessor directive in C?

a)

#define

b)

print()

c)

int main()

d)

return 0

19.

What is the correct syntax for including a standard header file in C?

a)

import

b)

include

c)

#include

d)

using

20.

Identify the correct output of the following C code:

#include

int main() {

printf("Hello, World!");

return 0;

}

a)

Hello, World!

b)

Compilation error

c)

Runtime error

d)

No output

21.

Which keyword is used to declare a variable in C?

a)

int

b)

var

c)

let

d)

define

22.

Which operator is used for division in C?

a)

*

b)

/

c)

%

d)

//

23.

What will be the output of the following C program?

#include<stdio.h>

int main() {

int a , b ;

a=20;

b=35;

int sum = a+b;

printf("The sum of %d and %d is ",a, b, sum);

return 0;

}

4 lines
24.

What is the purpose of the return statement in C?

a)

Terminates the program immediately

b)

Returns a value from a function

c)

Skips the next statement

d)

Converts data types

25.

What is an example of a selection control structure in C?

a)

for loop

b)

if-else statement

c)

while loop

d)

function call

26.

A function in C must have:

a)

A return type

b)

A name

c)

Parameters

d)

Both a and b

27.

In C, which statement correctly declares a function prototype?

a)

void func(int a);

b)

int func = (int a);

c)

prototype func(int a);

d)

func(int a);

28.

What will be the output of the following C program?

a)

2.5

b)

2

c)

3

d)

Compilation Error

29.

What will be the output of the following C program?

a)

10

b)

20

c)

Compilation error

d)

Undefined behavior

30.

What will be the output of the following C program?

a)

Greater than 5

b)

Less than 5

c)

Compilation Error

d)

No Output

31.

What will be the output of the following C program?

a)

One

b)

Two

c)

Two

Three

d)

Default