C Programming Coding Assessment

C Programming Coding Assessment

1st Grade

25 Qs

quiz-placeholder

Similar activities

ULANGAN HARIAN KOMPUTER - KELAS 3

ULANGAN HARIAN KOMPUTER - KELAS 3

1st - 5th Grade

20 Qs

5. Sınıf Kesirler ve Ondalık Kesirler

5. Sınıf Kesirler ve Ondalık Kesirler

1st - 5th Grade

20 Qs

PTS INFORMATIKA 2022

PTS INFORMATIKA 2022

1st Grade

20 Qs

SIMULASI DIGITAL BAB 1

SIMULASI DIGITAL BAB 1

1st Grade

20 Qs

ANALISIS DATA KALS 8

ANALISIS DATA KALS 8

1st Grade

20 Qs

Tin học 11 chương I

Tin học 11 chương I

1st - 12th Grade

20 Qs

Social Media and the Internet Safety

Social Media and the Internet Safety

1st - 11th Grade

21 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

Create a free account and access millions of resources

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?