Search Header Logo

SASI -1st year -DAY1-AN(19.12.23)

Authored by CCC info@ccc.training

English

Professional Development

Used 1+ times

SASI -1st year -DAY1-AN(19.12.23)
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

#include <stdio.h> 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

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> void main() { int ch; printf("enter a value between 1 to 2:"); scanf("%d", &ch); switch (ch) { case 1: printf("1\n"); break; printf("hi"); default: printf("2\n"); } }

1
hi 2
Run time error
2

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> int main() { int a = 1, b = 1; switch (a) { case a*b: printf("yes "); case a-b: printf("no\n"); break; } }

yes
no
Compile time error
yes no

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> int main() { int x = 97; switch (x) { case 'a': printf("yes "); break; case 97: printf("no\n"); break; } }

yes
yes no
Duplicate case value error
character case value error

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> int main() { float f = 1; switch (f) { case 1.0: printf("yes\n"); break; default: printf("default\n"); } }

yes
yes defined behaviour
undefined behaviour
compile time error

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> #define max(a) a int main() { int x = 1; switch (x) { case max(2): printf("yes\n"); case max(1): printf("no\n"); break; } }

yes no
yes
no
compile time error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h> int main() { switch (printf("Do")) { case 1: printf("First\n"); break; case 2: printf("Second\n"); break; default: printf("Default\n"); break; } }

Do
DoFirst
DoSecond
DoDefault

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?