Search Header Logo

C Programming Quiz 2

Authored by Telugu squad

Information Technology (IT)

University

Used 1+ times

C Programming Quiz 2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which operator is used to access the address of a variable?

*

&

#

@

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output? int a = 10, b = 5, c; c = a > b ? a : b; printf("%d", c);

10

5

0

1

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code? #include int main() { int a[] = {1, 2, 3, 4, 5}; int *p = a; printf("%d", *(p + 2)); return 0; }

1

2

3

Garbage Value

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following is a valid main function declaration?

void main()

int main()

main()

All of the above

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output? #include void main() { static int i; printf("%d", i); }

Garbage value

0

1

Error

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which function is used to read a string from the standard input?

gets()

scanf()

getchar()

Both a and b

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the role of the stdlib.h header file?

Standard Input/Output

String operations

Memory allocation functions like malloc()

Mathematical functions

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?