Search Header Logo

Programming Lab Quiz

Authored by Yash Sinha

Computers

University

Used 1+ times

Programming Lab Quiz
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

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

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?