
PASS 4
Quiz
•
Instructional Technology
•
University
•
Practice Problem
•
Hard
Evan Baker
FREE Resource
Enhance your content in a minute
6 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
15 mins • 1 pt
Which of these would print these variables in one printf statement?
int var1 = 4;
float var2 = 6.5;
double var3 = 6.3;
printf("%f, %f, %lf", var1, var2, var3);
printf("%d, %f, %lf", var1, var2, var3);
printf("%d, %lf, %f", var1, var2, var3);
printf("%d, %d, %d", var1, var2, var3);
2.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
Which of these is the preferred way to print these variables in one printf statement?
int var1 = 4;
float var2 = 6.5;
double var3 = 6.3;
printf("%f, %f, %lf", var1, var2, var3);
printf("%d, %f, %lf", var1, var2, var3);
printf("%d, %lf, %f", var1, var2, var3);
printf("%d, %d, %d", var1, var2, var3);
3.
MULTIPLE SELECT QUESTION
15 mins • 1 pt
Which checks if a user input is a multiple of 3?
if(input/3)
if(!(input %3))
if((input/3)>0)
if((input % 3)==0)
4.
MULTIPLE SELECT QUESTION
15 mins • 1 pt
Which checks if a variable named "input" is between 5 and 7 inclusive?
if ( ( (input % 5)>0) && ( (input % 7)<0) )
if ((input ==5) || (input == 6) || (input == 7))
if ((input>=5)&&(input<=7))
if (!(input<5)||(input>7))
5.
MULTIPLE CHOICE QUESTION
15 mins • 1 pt
The following code is provided:
int var = 0;
scanf("%d",&int);
Which statement only executes if the user inputs a value greater than 10
if(var>=10){
printf("output");
}
if ((var=10)){
printf("output");
}
if ((var>10));{
printf("output");
}
if(var>10){
printf("output");
}
6.
MULTIPLE SELECT QUESTION
15 mins • 1 pt
The following is provided:
int var = 0;
scanf("%d",&var);
The program should return a different output for every input up to 2 excluding 0, and then print the same response for everything else
switch(var){
case 1:
printf("One");
break;
case 2:
printf("Two");
break;
default:
printf("Default response");
switch(var){
case 1:
printf("One");
case 2:
printf("Two");
default:
printf("Default response");
if(var<1){
printf("Default response");}
else if (var<2){
printf("One");}
else if (var<3){
printf("Two");}
else{
printf("Default response");}
if(var<1){
printf("Default response");}
if (var<2){
printf("One");}
if (var<3){
printf("Two");}
else{
printf("Default response");}
Similar Resources on Wayground
10 questions
CONFIGURACIÓN DE CENTRALES TELEFÓNICAS IP - Semana 05
Quiz
•
University
9 questions
01 - Aula de Introdução à Python
Quiz
•
10th Grade - University
6 questions
TRIAL CLASS THUNKABLE
Quiz
•
12th Grade - University
6 questions
INT6066 - Green Energy
Quiz
•
University
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
10 questions
QUIZ Pra UTS Jaringan Nirkabel - Radian Baratasena
Quiz
•
University
10 questions
Clutch Brake Quiz
Quiz
•
University
10 questions
EDIT 3560 -Week 2 Review
Quiz
•
University - Professi...
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Instructional Technology
10 questions
Identifying equations
Quiz
•
KG - University
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
HS2C2 AB QUIZIZZ
Quiz
•
1st Grade - Professio...
14 questions
Homonyms Quiz
Quiz
•
KG - University
16 questions
Parts of a Parabola
Quiz
•
8th Grade - University
10 questions
A Brief History of Geologic Time
Interactive video
•
11th Grade - University
15 questions
Black Friday/Cyber Monday
Quiz
•
9th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
