C Programming Quiz

C Programming Quiz

12th Grade - University

20 Qs

quiz-placeholder

Similar activities

C - Flow Control

C - Flow Control

University

20 Qs

C-Extended

C-Extended

University

16 Qs

Coding club Summit Online Quiz

Coding club Summit Online Quiz

University

15 Qs

Beginning C Programming

Beginning C Programming

University

23 Qs

Programming Round 1

Programming Round 1

12th Grade - University

21 Qs

C - Structures

C - Structures

University

20 Qs

Playing with C

Playing with C

University

20 Qs

Operators in C

Operators in C

University

24 Qs

C Programming Quiz

C Programming Quiz

Assessment

Quiz

Computers

12th Grade - University

Hard

Created by

Ebenesar J

Used 654+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int x = 5;

if (x < 1)

printf("hello");

if (x == 5)

printf("hi");

else

printf("no");

}

hi

hello

no

error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int x = 0;

if (x == 1)

if (x == 0)

printf("inside if\n");

else

printf("inside else if\n");

else

printf("inside else\n");

}

inside if

inside else if

inside else

compile time error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int x = 0;

if (x == 1)

if (x >= 0)

printf("true\n");

else

printf("false\n");

}

Depends on the compiler

No print statement

True

False

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

The switch statement takes a given integer value then seeks a matching value among a number of _______ statements.

break

case

switch

goto

5.

MULTIPLE CHOICE QUESTION

5 sec • 1 pt

How many loops are there in C

1

3

2

4

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which of the following is an exit control statement

for

while

do while

continue

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

The value of i after the execution of the following segment is

i = 2;

for( i=0; i>10; i=i+1);

1

2

0

11

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?