Learn2Code

Learn2Code

Professional Development

30 Qs

quiz-placeholder

Similar activities

Quiz về Radar SSR Mode S

Quiz về Radar SSR Mode S

Professional Development

25 Qs

Pre Test in Soil

Pre Test in Soil

Professional Development

25 Qs

Шпшп40/50

Шпшп40/50

Professional Development

25 Qs

SET D - DPWH

SET D - DPWH

Professional Development

28 Qs

QUIZZERIA

QUIZZERIA

Professional Development

25 Qs

D43 QUIZ OF THE DAY

D43 QUIZ OF THE DAY

Professional Development

25 Qs

UD5_ISF

UD5_ISF

Professional Development

34 Qs

Quiz sobre Linhas de Transmissão

Quiz sobre Linhas de Transmissão

Professional Development

35 Qs

Learn2Code

Learn2Code

Assessment

Quiz

Engineering

Professional Development

Hard

Created by

arun h

Used 1+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program?

#include <stdio.h>
int main() {
int i;
for (i = 0; i < 5; i++);
printf("%d ", i);
return 0;
}

Prints 0 1 2 3 4

Prints 5 only

Infinite loop

Compilation error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of executing the following code?

#include <stdio.h>
int main() {
    for (int j = 0; j < 3; j++) {
        printf("Hello World\n");
    }
    return 0;
}

Hello World Hello World Hello World

3 times Hello World

Compilation error

Hello World

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the result of the following code?

#include <stdio.h>

int main() {

int a = 10, b = 0;

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

return 0;

}

0

10

Runtime error (division by zero)

Compilation error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen when you run this program?

#include <stdio.h>

int main() {

int arr[5] = {1, 2, 3, 4, 5};

printf("%d", arr[5]);

return 0;

}

Output is 5

Output is 0

Undefined behavior / garbage value

Compilation error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What’s wrong in the following code?

#include <stdio.h>

int main() {

int i = 1;

while (i <= 5) {

printf("%d ", i);

}

return 0;

}

Infinite loop

Compilation error

Prints 1 to 5

Prints 1 repeatedly and exits

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this code?

#include <stdio.h>

int main() {

int a = 7;

if (a = 10) {

printf("Condition is true\n");

}

return 0;

}

Condition is true

Compilation error

Condition is false

No output

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this code print?

#include <stdio.h>

int main() {

int a = 5;

printf("%d\n", a++ + ++a);

return 0;

}

11

12

Undefined behavior

Compilation error

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?