C Programming Coding Assessment

C Programming Coding Assessment

1st Grade

25 Qs

quiz-placeholder

Similar activities

C++ podstawowe pojęcia

C++ podstawowe pojęcia

1st - 5th Grade

24 Qs

C basics

C basics

1st - 4th Grade

25 Qs

Ponteiros em C

Ponteiros em C

1st - 10th Grade

24 Qs

Assignment Quiz 1- C Programming 2023

Assignment Quiz 1- C Programming 2023

1st Grade

20 Qs

PD 3.2

PD 3.2

1st Grade

20 Qs

quiz dasar python

quiz dasar python

1st Grade - University

20 Qs

KUIZ SAS INFORMATIKA

KUIZ SAS INFORMATIKA

1st Grade

20 Qs

X-Tech Riot (4)

X-Tech Riot (4)

1st Grade

20 Qs

C Programming Coding Assessment

C Programming Coding Assessment

Assessment

Quiz

Computers

1st Grade

Hard

Created by

Jeyam Jacqueline S

Used 2+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?