PASS 4

PASS 4

University

6 Qs

quiz-placeholder

Similar activities

APLIKASI KOMPUTER

APLIKASI KOMPUTER

University

10 Qs

Pseudocode

Pseudocode

University

10 Qs

ขั้นตอนการพัฒนาโปรแกรม

ขั้นตอนการพัฒนาโปรแกรม

12th Grade - University

10 Qs

Sejarah Komputer, Hardware dan Software

Sejarah Komputer, Hardware dan Software

University

10 Qs

PMSB Teori dan Prinsip Komputer dan Multimedia

PMSB Teori dan Prinsip Komputer dan Multimedia

University

10 Qs

QUIZ 1 MBS 4A

QUIZ 1 MBS 4A

University

10 Qs

Çoklu Ortam Quiz

Çoklu Ortam Quiz

University

11 Qs

PM Time Management

PM Time Management

University

10 Qs

PASS 4

PASS 4

Assessment

Quiz

Instructional Technology

University

Practice Problem

Hard

Created by

Evan Baker

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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");}

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?