MCQ BMC-151

MCQ BMC-151

University

20 Qs

quiz-placeholder

Similar activities

ARRAYS AND FUNCTIONS

ARRAYS AND FUNCTIONS

University

15 Qs

Programming Round 1

Programming Round 1

12th Grade - University

21 Qs

Recap

Recap

University

15 Qs

C - Structures

C - Structures

University

20 Qs

Playing with C

Playing with C

University

20 Qs

C-Extended

C-Extended

University

16 Qs

C - Flow Control

C - Flow Control

University

20 Qs

XTK022 C Programming Test 1

XTK022 C Programming Test 1

University

20 Qs

MCQ BMC-151

MCQ BMC-151

Assessment

Quiz

Computers

University

Easy

Created by

Gunjan Verma

Used 2+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the below code snippet?

int i = 0;

while (i < 5) {

    if (i == 3) break;

    printf("%d ", i);

    i++;

}

0 1 2 4
1 2 3 4
0 1 2 3
0 1 2

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In nested loops, when the break statement is encountered in the inner loop, what happens?

The program terminates completely.
The outer loop is exited immediately.
The inner loop is exited, and control goes to the outer loop.
The inner loop continues to run until its condition is false.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to declare a function prototype for a function func that takes two integers and returns a float?

float func(int): float;

float func(int a, int b);

void func(int, int) return float;
int func(int, int) -> float;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following code, what will the output be?

void func(int a) {

a = 10;

}

int main() {

int x = 5;

func(x);

printf("%d", x);

}

10
5.0
0
5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly describes the scope of a variable declared inside a function?

It is accessible only within that function.

It is accessible throughout the entire program.

It is accessible in all functions of the same file.

It is accessible in all files of the project.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this code?

int multiply(int a, int b) {

return a * b;

}

int main() {

int a = 2, b = 3, c = multiply(a++, b++);

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

}

1 2 6
4 5 8
3 4 6
2 3 5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a benefit of using a high-level programming language?

Easier debugging and error handling
Faster execution speed
Simplified syntax for complex tasks
Greater control over system resources

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?