💩

programierds

Tests
C Beginner 15 min

Conditionals in C

Test to learn how to use if, if-else and nested if in C.

questions

30

Tiempo estimado

15:00:00

Avance: 0%

C Beginner 15 min 30 preguntas

Conditionals in C

Test to learn how to use if, if-else and nested if in C.

Pregunta 1

What is the if structure used for in C?

Opciones para What is the if structure used for in C?

Pregunta 2

What does this code print?

Snippet c
int x = 10;
if(x > 5){
  printf("Greater");
}
Opciones para What does this code print?

Pregunta 3

What happens if the if condition is false and there is no else?

Opciones para What happens if the if condition is false and there is no else?

Pregunta 4

What does this print?

Snippet c
int x = 3;
if(x > 5){
  printf("A");
} else {
  printf("B");
}
Opciones para What does this print?

Pregunta 5

Which operator compares equality?

Opciones para Which operator compares equality?

Pregunta 6

What does this print?

Snippet c
int x = 7;
if(x == 7){
  printf("Correct");
}
Opciones para What does this print?

Pregunta 7

Which operator means 'different from'?

Opciones para Which operator means 'different from'?

Pregunta 8

What does this print?

Snippet c
int x = 4;
if(x != 5){
  printf("Different");
}
Opciones para What does this print?

Pregunta 9

What is a nested if?

Opciones para What is a nested if?

Pregunta 10

What does this print?

Snippet c
int x = 8;
if(x > 5){
  if(x < 10){
    printf("Between 5 and 10");
  }
}
Opciones para What does this print?

Pregunta 11

Which operator represents 'greater than'?

Opciones para Which operator represents 'greater than'?

Pregunta 12

What does this print?

Snippet c
int x = 2;
if(x < 5){
  printf("Smaller");
}
Opciones para What does this print?

Pregunta 13

What does else do?

Opciones para What does else do?

Pregunta 14

What does this print?

Snippet c
int x = 6;
if(x > 10){
  printf("A");
} else {
  printf("B");
}
Opciones para What does this print?

Pregunta 15

What does this print?

Snippet c
int x = 10;
if(x >= 10){
  printf("OK");
}
Opciones para What does this print?

Pregunta 16

What does >= mean?

Opciones para What does >= mean?

Pregunta 17

What does this print?

Snippet c
int x = 1;
if(x == 0){
  printf("Zero");
} else {
  printf("Not zero");
}
Opciones para What does this print?

Pregunta 18

Which operator represents less than?

Opciones para Which operator represents less than?

Pregunta 19

What does this print?

Snippet c
int x = 4;
if(x <= 4){
  printf("OK");
}
Opciones para What does this print?

Pregunta 20

What does if do?

Opciones para What does if do?

Pregunta 21

What does this print?

Snippet c
int x = 3;
if(x > 1){
  printf("A");
}
Opciones para What does this print?

Pregunta 22

What does this print?

Snippet c
int x = 2;
if(x == 3){
  printf("A");
} else {
  printf("B");
}
Opciones para What does this print?

Pregunta 23

What does this print?

Snippet c
int x = 9;
if(x > 5){
  printf("Greater");
}
Opciones para What does this print?

Pregunta 24

What does this print?

Snippet c
int x = 0;
if(x){
  printf("True");
}
Opciones para What does this print?

Pregunta 25

What does this print?

Snippet c
int x = 1;
if(x){
  printf("True");
}
Opciones para What does this print?

Pregunta 26

What does the { } block do?

Opciones para What does the { } block do?

Pregunta 27

What does this print?

Snippet c
int x = 5;
if(x == 5){
  printf("Five");
}
Opciones para What does this print?

Pregunta 28

What does this print?

Snippet c
int x = 8;
if(x > 10){
  printf("A");
}
Opciones para What does this print?

Pregunta 29

What does this print?

Snippet c
int x = 7;
if(x < 10){
  printf("Smaller");
}
Opciones para What does this print?

Pregunta 30

What does if let you do?

Opciones para What does if let you do?

Elegi una opcion por pregunta y despues hace click en Revisar resultados.