C Programming Coding Assessment

C Programming Coding Assessment

1st Grade

25 Qs

quiz-placeholder

Similar activities

Quis Pemrograman Dasar #Part1

Quis Pemrograman Dasar #Part1

1st Grade

20 Qs

MATEMATICA EXTREMOS RELATIVOS

MATEMATICA EXTREMOS RELATIVOS

1st Grade

20 Qs

Sistemas operativos 1

Sistemas operativos 1

1st - 10th Grade

20 Qs

QUIZ ORGANISASI DAN ARTSITEKTUR KOMPUTER

QUIZ ORGANISASI DAN ARTSITEKTUR KOMPUTER

1st - 5th Grade

20 Qs

Coding Karel 2

Coding Karel 2

KG - University

20 Qs

Administrasi Sistem jaringan KD1

Administrasi Sistem jaringan KD1

1st - 10th Grade

20 Qs

Operating System Concept Management

Operating System Concept Management

1st - 3rd Grade

20 Qs

Give kids a hand | Scratch Round1

Give kids a hand | Scratch Round1

1st - 7th 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?