What is the correct way to declare an integer variable in C?

C Programming Quiz

Quiz
•
Computers
•
Professional Development
•
Medium
AKHILA P
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
int 1number;
int number1;
number int;
int ; number1
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for a for loop in C?
for (i = 0; i < 10; i++)
for (i < 10; i++)
for i = 0; i < 10; i++
for (i = 0; i < 10)
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you access the third element of an array named arr in C?
arr[2]
arr[3]
arr(3)
arr{3}
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid if statement in C?
if x > 10
st1;
if (x > 10)
{
st1;
}
if (x > 10);
st1;
if x > 10
{
st1;
}
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which library is required to use the strlen function?
stdlib
stdio
string
ctype
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code? for (int i = 0; i < 5; i++) { printf("%d ", i); }
0 1 2 3 4
1 2 3 4 5
0 1 2 3 4 5
error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for a while loop in C?
while (condition) { statement; }
while condition { statement; }
while (condition) statement;
while { condition; }
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
C Code Master

Quiz
•
Professional Development
15 questions
Code X Trade

Quiz
•
Professional Development
25 questions
C Language Test - 2

Quiz
•
Professional Development
20 questions
Java Quiz

Quiz
•
Professional Development
25 questions
C Language Test 3

Quiz
•
Professional Development
15 questions
C Language Quiz-1

Quiz
•
University - Professi...
20 questions
C-Quest

Quiz
•
Professional Development
20 questions
first round quiz

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade