Programming Quiz on C

Programming Quiz on C

University

20 Qs

quiz-placeholder

Similar activities

Java Quiz 2

Java Quiz 2

University

15 Qs

Aptitude Competition(FY)

Aptitude Competition(FY)

University

25 Qs

Pointers

Pointers

University

20 Qs

C programming

C programming

University

15 Qs

Milking Minds 2 17-01-24

Milking Minds 2 17-01-24

University

15 Qs

C Language Pre-Assessment

C Language Pre-Assessment

University

25 Qs

PEP OS INPUT

PEP OS INPUT

University

20 Qs

Computer Fundamental and C Programming  Concept

Computer Fundamental and C Programming Concept

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?