Search Header Logo

C Programming Quiz2

Authored by Sunil Kumar

Engineering

University

Used 3+ times

C Programming Quiz2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What would be output:

12

16

18

12

16

20

12

16

17

11

12

20

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is #include <stdio.h>?

Preprocessor directive

Inclusion directive

File inclusion directive

None

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

  1. #include <stdio.h>

  2. int main()

  3. {

  4. int y = 10000;

  5. int y = 34;

  6. printf("Hello World! %d\n", y);

  7. return 0;

  8. }

Compile time error

10000
Hello World!
int y = 50;

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

for(x = 1; x = 3; x++)

How many times above loop would run?

4

Never

3

5

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

#include<stdio.h>

void main() {
int num = 0;
do {
- - num;
printf(“%d”, num);
num ++;
}
while(num >= 0);
}

A run time error will be reported

The program will not enter into the loop

The loop will run infinitely many times

Compile time error

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main() {
  int value = 0;
  if(value)
    printf("well done");
  printf("Algbly");
  return 0;
}
What would be output:

well done
good job
successfully completed
Algbly

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

  1. #include <stdio.h>

  2. int main()

  3. {

  4. int i = 0;

  5. int x = i++, y = ++i;

  6. printf("%d % d\n", x, y);

  7. return 0;

  8. }

    What would be output:

0 2
1 3
0 1
1 2

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?