CIS1101-programming practice

Quiz
•
Computers
•
University
•
Medium
Karen Tan
Used 8+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
char ch;
for(ch='a'; ch<='z'; ch++)
{
printf("%c\n", ch);
}
The program will display the alphabet from a to z
The program will display the alphabet from A to Z
The program will display the alphabet from A and Z
The program will display the alphabet from a and z
The program will display the alphabet from a or z
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int i, n=100;
for(i=1; i<=n; i++) {
printf("%d\n", i);
}
The program will display the numbers from 1 and 100
The program will display the numbers from 1 or 100
The program will display the numbers from 1 to 100
The program will display the numbers from 1 by 100
The program will display the numbers from 1 on 100
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int i, start=50;
printf("Enter starting value: ");
scanf("%d", &start);
for(i=start; i>=1; i--){
printf("%d\n", i); }
The program will display the numbers from 50 by 1
The program will display the numbers from 50 or 1
The program will display the numbers from 50 and 1
The program will display the numbers from 50 to 0
The program will display the numbers from 50 to 1
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int i, n=1000;
printf("Print all even numbers till: ");
scanf("%d", &n);
printf("Even numbers from 1 to %d are: \n", n);
for(i=1; i<=n; i++) {
if(i%2 == 0){
printf("%d\n", i);
}}
The program will display some even numbers from 1-1000
The program will display few even numbers from 1-1000
The program will display all even numbers from 1-1000
The program will display more even numbers from 1-1000
The program will display much even numbers from 1-1000
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
int i, n=500;
for(i=1; i<=n; i++) {
if(i%2!=0) {
printf("%d\n", i);
} }
The program will display some odd numbers from 1-500
The program will display all odd numbers from 1-500
The program will display much odd numbers from 1-500
The program will display more odd numbers from 1-500
The program will display many odd numbers from 1-500
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
char gender='f';
if(gender=='m')
printf("male");
else if(gender=='f')
printf("female");
else
printf("invalid");
The program display male, female, or invalid depending on the gender char input
The program get male, female, or invalid depending on the gender char input
The program display male, female depending on the gender char input
The program display male and female and invalid depending on the gender char input
The program display female, or invalid depending on the gender char input
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
The code in red is known as the function header
The code in red is known as the function parameter
The code in red is known as the function name
The code in red is known as the return type
The code in red is known as the library or preprocessor
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Array in C

Quiz
•
University
18 questions
Programming in C language

Quiz
•
12th Grade - University
20 questions
CCE-III Programming in C Language

Quiz
•
University
20 questions
Basics of programming - Quiz - 01

Quiz
•
University - Professi...
11 questions
Basics of JAVA

Quiz
•
University
20 questions
C programming syntax quiz

Quiz
•
University
13 questions
C programming-1

Quiz
•
University
10 questions
Input And Output in C

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

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

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University