CIS1101-programming practice2
Quiz
•
Computers
•
University
•
Practice Problem
•
Easy
Karen Tan
Used 2+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
int int1=9, int2=3;
if (int1 == int2)
printf("%d", int1/int2);
else
printf("%d", int1%int2);
3
0
9
1
2
2.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
int num=15;
if (num >= 0)
printf("%d\n", num*=2);
else
printf("%d\n", num%=2);
20
10
50
30
40
3.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
int m=7,n=3;
if(m>n)
printf("%d", m%n);
else if(m<n)
printf("%d", m/n);
else
printf("%d", m*n);
5
4
6
3
7
4.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
float PerHeight = 178.89;
if (PerHeight < 150.0)
printf("The person is Dwarf. \n");
else if ((PerHeight >= 150.0) && (PerHeight < 165.0))
printf("The person is average heighted. \n");
else if ((PerHeight >= 165.0) && (PerHeight <= 195.0))
printf("The person is taller. \n");
else
printf("Abnormal height.\n");
The person is Dwarf
The person is average heighted.
The person is taller.
Abnormal height
5.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
int num1=5, num2=9, num3=3;
if ((num1 > num2) && (num1 > num3))
printf("The 1st Number is the greatest among three. \n");
if ((num2 > num3) && (num2 > num1))
printf("The 2nd Number is the greatest among three \n");
if ((num3 > num1) && (num3 > num2))
printf("The 3rd Number is the greatest among three. \n");
The 1st Number is the greatest among three.
The 2nd Number is the greatest among three.
The 3rd Number is the greatest among three.
The 3 numbers are equal
6.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
What is the output of the following code snippet?
int sidea=32, sideb=35, sidec=32;
if(sidea==sideb && sideb==sidec)
{ printf("This is an equilateral triangle.\n"); }
else if(sidea==sideb || sidea==sidec || sideb==sidec)
{ printf("This is an isosceles triangle.\n"); }
else
{ printf("This is a scalene triangle.\n"); }
Equilateral
Isosceles
Scalene
7.
MULTIPLE CHOICE QUESTION
1 min • 5 pts
Debug the following code below to make it run:
int int1, int2
printf(Input the values for Number1 and Number2 : ");
scanf("%d %d, &int1, int2);
if (int1 == int2);
printf("Number1 and Number2 are equal\n");
else
printf("Number1 and Number2 are not equal\n")
line 1: remove ;
line2: add open "
line 3: remove close " add & for int 2
line 4: remove ;
line 7: remove ;
line 1: add ;
line2: add close "
line 3: add open " add & for int 2
line 4: add ;
line 7: add ;
line 1: add ;
line2: add open "
line 3: add close " add & for int 2
line 4: remove ;
line 7: add ;
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
CODE ZENITH
Quiz
•
University
15 questions
3 - Informatique décisionnelle
Quiz
•
University
13 questions
Les écrans : amis ou ennemis de l'enfance ?
Quiz
•
University
15 questions
IT 209
Quiz
•
University
15 questions
Ordenamiento&DivideVencerás
Quiz
•
University
10 questions
TIC - S11
Quiz
•
University
10 questions
ARRAYS 1
Quiz
•
University
15 questions
Post-Test Microsoft Word (G2)
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
