C Programming Coding Assessment

C Programming Coding Assessment

1st Grade

25 Qs

quiz-placeholder

Similar activities

CLASS 1 THE MOUSE

CLASS 1 THE MOUSE

1st - 2nd Grade

20 Qs

ASJ

ASJ

1st Grade

20 Qs

Medienwelt

Medienwelt

1st - 6th Grade

20 Qs

TIN HỌC 8.HK1

TIN HỌC 8.HK1

KG - 2nd Grade

20 Qs

SOAL PAT 2020/2021 (PEMOGRAMAN DASAR)

SOAL PAT 2020/2021 (PEMOGRAMAN DASAR)

1st Grade

20 Qs

ÔN TẬP TIN 8 GIỮA KÌ 2

ÔN TẬP TIN 8 GIỮA KÌ 2

1st Grade

25 Qs

Aplikom

Aplikom

1st Grade - University

20 Qs

TOT Dual Track Kaltim

TOT Dual Track Kaltim

1st - 3rd Grade

20 Qs

C Programming Coding Assessment

C Programming Coding Assessment

Assessment

Quiz

Computers

1st Grade

Practice Problem

Hard

Created by

Jeyam Jacqueline S

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the code? #include int main() { int a = 5, b = 10; a = a + b; b = b - a; a = a - b; printf("a = %d, b = %d\n", a, b); return 0; }

10

15

5

20

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How many times the while loop will get executed if a short int is 2 byte wide? #include int main() { int j=1; while(j <= 255) { printf("%c %d\n", j, j); j++; } return 0; }

Infinite times

255 times

256 times

254 times

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following errors would be reported by the compiler on compiling the program given below? #include int main() { int a = 5; switch(a) { case 1: printf("First"); case 2: printf("Second"); case 3 + 2: printf("Third"); case 5: printf("Final"); break; } return 0; }

There is no break statement in each case.

Expression as in case 3 + 2 is not allowed.

Duplicate case case 5:

No error will be reported.

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Point out the error, if any in the program. #include int main() {int P = 10; switch(P) { case 10: printf("Case 1"); case 20: printf("Case 2"); break; case P: printf("Case 2"); break; } return 0; }

Error: No default value is specified

Error: Constant expression required at line case P:

Error: There is no break statement in each case.

No error will be reported.

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the program? #include int main() { int i=2; printf("%d, %d\n", ++i, ++i); return 0; }

3, 4

4, 3

4, 4

Output may vary from compiler to compiler

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How many times the program will print "SMTEC" ? #include int main() { printf("SMTEC"); main(); return 0; }

Infinite times

32767 times

65535 times

Till stack overflows

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the program? #include #define SQR(x)(x*x) int main() { int a, b=3; a = SQR(b+2); printf("%d\n", a); return 0; }

25

11

Error

Garbage value

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?