C Programming

SEQUENCE STATEMENTS MULTIPLE CHOICE QUESTIONS

1

What is sequencing in computer programming?

A.

Breaking a problem into smaller, manageable parts.

B.

The order in which instructions are executed in a program.

C.

Repeating a block of code multiple times.

D.

Making a decision based on a condition.

2

In what order does a computer execute a sequence of statements?

A.

Bottom to top.

B.

Randomly to save time.

C.

Top to bottom, one line after another.

D.

Only the lines that are highlighted.

3

Which of the following real-world activities best represents a correct sequence for making a cup of tea?

A.

Add hot water to cup → Drink tea → Boil water.

B.

Boil water → Add water to cup → Add tea bag.

C.

Add tea bag → Drink tea → Add hot water.

D.

Put tea in cup → Boil water → Throw away cup.

4

What is most likely to happen if the sequence of instructions in an algorithm is incorrect?

A.

The computer will automatically fix the order.

B.

The program will run faster.

C.

The algorithm will not produce the intended result or will fail.

D.

The computer will turn off.

5

In a C program designed to calculate the square of a number, what is the correct sequence of statements?

A.

printf("Result: %d", sq); → sq = num * num; → scanf("%d", &num);

B.

sq = num * num; → scanf("%d", &num); → printf("Result: %d", sq);

C.

scanf("%d", &num); → sq = num * num; → printf("Result: %d", sq);

D.

printf("Result: %d", sq); → scanf("%d", &num); → sq = num * num;

6

In the following sequence, what will happen at line 2?

  1. int age;
  2. scanf("%d", age);
  3. printf("Your age is %d", age);

A.

The program will correctly store the age in memory.

B.

The program will crash or cause an error because the & (address-of) operator is missing.

C.

The program will skip line 2 and move to line 3.

D.

The program will print the age before the user even types it.