Programming Quiz on C

Programming Quiz on C

University

20 Qs

quiz-placeholder

Similar activities

Coding club Summit Online Quiz

Coding club Summit Online Quiz

University

15 Qs

Programming Homework Questions

Programming Homework Questions

University

17 Qs

Technical Quiz

Technical Quiz

University

20 Qs

OPC MCQ's

OPC MCQ's

12th Grade - University

20 Qs

C-Py QUIZ | ROUND 1

C-Py QUIZ | ROUND 1

University

20 Qs

OCS752_CP_WEEKLY_TEST3 (20.08.2020)

OCS752_CP_WEEKLY_TEST3 (20.08.2020)

University

20 Qs

C Quest 2.0

C Quest 2.0

University

20 Qs

Fundamentals of data Structures & Linked list

Fundamentals of data Structures & Linked list

University

20 Qs

Programming Quiz on C

Programming Quiz on C

Assessment

Quiz

Computers

University

Hard

Created by

Santhoshi V

Used 2+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the equivalent code of the following statement in WHILE LOOP format?

for (a=1; a<=100; a++)

printf ("%d\n", a * a);

a=1;

while (a<=100)

{

printf ("%d\n", a * a); a++;

}

a=0;

while (a<=100)

{

printf ("%d\n", a * a); a++;

}

a=1;

while (a>=100)

{

printf ("%d\n", a * a); a++;

}

while (a<=100)

{

printf ("%d\n", a * a); a++;

}

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code?

for (a=1; a<=5; i++)

{

for (b=1; b<=a; b++)

printf("%d",b);

printf("\n");

}

1

1 2

1 2 3

1 2 3 4

1

2 2

3 3 3

4 4 4 4

5 5 5 5 5

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

None

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

int main() {

char str[] = "Hello";

printf("%c", *(str + 1));

return 0;

}

H

e

l

o

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code?

void fun(int *p) {

*p = *p + 10;

}

int main() {

int a = 5;

fun(&a);

printf("%d", a);

return 0;

}

5

10

15

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

int main() {

int x = 10;

printf("%d %d %d", x++, x++, ++x);

return 0;

}

10 11 13

12 12 12

Undefined behavior

Compilation Error

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code?int main() {

int x = 5, y = 10, z = 15;

int *arr[] = {&x, &y, &z};

printf("%d", *arr[1]);

return 0;

}

5

10

15

20

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code?

int main() {

int a = 3, b = 4;

printf("%d", a+++b);

return 0;

}

7

8

3

Error

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?