Search Header Logo

MCQ BMC-151

Authored by Gunjan Verma

Computers

University

Used 2+ times

MCQ BMC-151
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?