Programming Lab Quiz

Programming Lab Quiz

University

20 Qs

quiz-placeholder

Similar activities

PPS : Quiz 2

PPS : Quiz 2

University

15 Qs

BASIC C QUIZ

BASIC C QUIZ

University

15 Qs

Bridge course with C

Bridge course with C

University

20 Qs

C Programing

C Programing

University

25 Qs

C BOOTCAMP DAY 2

C BOOTCAMP DAY 2

University

20 Qs

Pointers in C

Pointers in C

University

24 Qs

Coding and Debugging

Coding and Debugging

University

15 Qs

BS TEST2

BS TEST2

University

20 Qs

Programming Lab Quiz

Programming Lab Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Yash Sinha

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which is valid C expression?

int my_num = 100,000;

int my_num = 100000;

int my num = 1000;

int $my_num = 10000;

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the result of logical or relational expression in C?

True or False

0 or 1

0 if an expression is false and any positive number if an expression is true

None of the mentioned

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is an example of iteration in C?

for

while

do-while

all of the mentioned

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C code? #include int main() { int y = 10000; int y = 34; printf("Hello World! %d\n", y); return 0; }

Compile time error

Hello World! 34

Hello World! 1000

Hello World! followed by a junk value

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will happen if the following C code is executed? #include int main() { int main = 3; printf("%d", main); return 0; }

It will cause a compile-time error

It will cause a run-time error

It will run without any error and prints 3

It will experience infinite looping

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C code? #include void main() { int x = 5; if (x < 1); printf("Hello"); }

Nothing

Run time error

Hello

Varies

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input) #include void main() { int ch; printf("enter a value between 1 to 2:"); scanf("%d", &ch); switch (ch) { case 1: printf("1\n"); default: printf("2\n"); } }

1

2

1 2

Run time 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?