C Language MCQs

C Language MCQs

University

30 Qs

quiz-placeholder

Similar activities

2.7 System Software

2.7 System Software

12th Grade - University

25 Qs

R E V I E W E R

R E V I E W E R

University

25 Qs

Angular 4

Angular 4

University

25 Qs

ITElec1_Recitation_1

ITElec1_Recitation_1

University

25 Qs

C++

C++

University

25 Qs

Application Software

Application Software

University

29 Qs

Ethics in Cyberspace

Ethics in Cyberspace

University

25 Qs

Quiz on Operating System Basics

Quiz on Operating System Basics

University

25 Qs

C Language MCQs

C Language MCQs

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

SImranjeet Kaur

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?