C Language MCQs

C Language MCQs

University

30 Qs

quiz-placeholder

Similar activities

C++ Programming Quiz

C++ Programming Quiz

University

25 Qs

Mastering Python Basics

Mastering Python Basics

University

30 Qs

String in C Programming

String in C Programming

University

26 Qs

 Milking Minds 17-01-24

Milking Minds 17-01-24

University

25 Qs

BSCE_MIDTERM_EXAM

BSCE_MIDTERM_EXAM

University

25 Qs

IPC144 - Week 3

IPC144 - Week 3

University

28 Qs

Computer Programming 1 Review

Computer Programming 1 Review

University

30 Qs

Compro. Final1/64 part2

Compro. Final1/64 part2

University

25 Qs

C Language MCQs

C Language MCQs

Assessment

Quiz

Computers

University

Hard

Created by

SImranjeet Kaur

Used 1+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code output? #include void main() { int x = 5, y = 10; printf("%d", x + y); }

5

10

15

Compilation error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which header file is required to use the printf() function in C?

stdio.h

stdlib.h

math.h

string.h

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a pointer in C?

int *ptr;

int ptr*;

int& ptr;

ptr int*;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? #include void main() { int arr[] = {1, 2, 3, 4}; printf("%d", arr[2]); }

1

2

3

Compilation error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about for loops is true?

The loop executes at least once even if the condition is false.

The loop continues until the condition becomes false.

The loop must have a break statement.

The loop cannot be nested.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of an int in C (on most platforms)?

1 byte

2 bytes

4 bytes

Depends on the compiler and platform

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in C?

123abc

_value

float

@data

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?