Computer Programming-2

Quiz
•
Computers
•
University
•
Hard
Zeel Mehta
Used 17+ times
FREE Resource
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will the following for loop iterate?
for (int i = 0; i < 5; i++) {
// code here
}
5
4
3
2
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax of a simple for loop in C?
for (initialize; condition; increment) { }
for (initialize: condition: increment); { }
for (initialize; condition: decrement); { }
for (initialize: condition: decrement) { }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to declare a 1-D array named "numbers" of 5 integers in C?
int numbers[ ] = {5};
numbers [5];
numbers = {5};
int numbers [5];
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
char str[5] = "Hello";
printf("%c", str[4]);
\0
e
l
o
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is not the correct way to initialize an array named "grades" with the values 90, 85, 95, and 80 in C?
int grade[10] ={90, 85, 95, 80};
int grades[4] = {90, 85, 95, 80};
int grades[ ] = {90, 85, 95, 80};
int grades[4] = {90, 85, 95, 80}
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following functions can be used to find the length of a string in C?
strlenn()
strnlen()
strlen()
strlan()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
char str1[10] = "Hello";
char str2[20] = {'H', 'e', 'l', 'l', 'o', ' ','\0'};
if (strcmp(str1, str2) == 0) {
printf("Equal");
} else {
printf("Not equal");
}
Runtime Error
Equal
Compile time Error
Not Equal
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
C/C++ Programming Quiz

Quiz
•
University
30 questions
แบบทดสอบหน่วยที่ 1-3 การเขียนโปรแกรมคอมพิวเตอร์

Quiz
•
University
30 questions
C quiz by Rachai

Quiz
•
5th Grade - University
25 questions
02/05/2025

Quiz
•
University
34 questions
Java Quiz

Quiz
•
11th Grade - University
25 questions
Embedded C Programming DA-1 (Part-1) - G2

Quiz
•
University
30 questions
Mid-Block Assessment

Quiz
•
University
27 questions
IEEE Coding Cybersecurity

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University