MPMNJ C Training (Control Statements Quiz)

MPMNJ C Training (Control Statements Quiz)

University

12 Qs

quiz-placeholder

Similar activities

String & Struct Exercise

String & Struct Exercise

University

17 Qs

Quiz on Functions#1

Quiz on Functions#1

University

15 Qs

unidad4

unidad4

University

10 Qs

De todo

De todo

1st Grade - Professional Development

16 Qs

POP QUIZ !

POP QUIZ !

University

8 Qs

Quiz 1 - Intro to C

Quiz 1 - Intro to C

University

10 Qs

C-Basic

C-Basic

University

10 Qs

คำสั่งวนรอบภาษาซี (post-test)

คำสั่งวนรอบภาษาซี (post-test)

3rd Grade - University

10 Qs

MPMNJ C Training (Control Statements Quiz)

MPMNJ C Training (Control Statements Quiz)

Assessment

Quiz

Computers

University

Medium

Created by

ROCK GOWTHAM

Used 2+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What is the output of the following C code?

#include <stdio.h>

int main() {

int a = 1;

if (a==1) a=2;

if (a==2) a=3;

printf("%d", a);

return 0;

}

1

2

3

0

2.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

if (0 == 0)

printf("True");

else

printf("False");

return 0;

}

True

False

None

Error

3.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

if (0, 1)

printf("True");

else

printf("False");

return 0;

}

True

False

Error

None

4.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

int x = 1, y = 0;

if (x && y)

printf("A");

else if (x || y)

printf("B");

else

printf("C");

return 0;

}

A

B

C

Error

5.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

int x = 5;

(x > 5) ? (x = 10) : (x = 0);

printf("%d", x);

return 0;

}

0

5

10

Error

6.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

int x = 5, y = 10;

printf("%d", (x > y) ? x : y);

return 0;

}

5

10

0

1

7.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

#include <stdio.h>

int main() {

int a = 5;

printf("%s", (a % 2 == 0) ? "Even" : "Odd");

return 0;

}

Even

Odd

Error

None

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?