💩

programierds

Tests
C Beginner 15 min

While in C - Full practice

Practice test on the use of while loops in C.

questions

30

Tiempo estimado

15:00:00

Avance: 0%

C Beginner 15 min 30 preguntas

While in C - Full practice

Practice test on the use of while loops in C.

Pregunta 1

What is the while loop used for in C?

Opciones para What is the while loop used for in C?

Pregunta 2

When is the while condition evaluated?

Opciones para When is the while condition evaluated?

Pregunta 3

What does this code print?

Snippet c
int i = 1;
while(i <= 3){
    printf("%d ", i);
    i++;
}
Opciones para What does this code print?

Pregunta 4

What happens if the while condition never becomes false?

Opciones para What happens if the while condition never becomes false?

Pregunta 5

What does this code print?

Snippet c
int i = 0;
while(i < 3){
    printf("%d ", i);
    i++;
}
Opciones para What does this code print?

Pregunta 6

Which is the correct syntax?

Opciones para Which is the correct syntax?

Pregunta 7

What does this code print?

Snippet c
int i = 5;
while(i > 0){
    printf("%d ", i);
    i--;
}
Opciones para What does this code print?

Pregunta 8

What does this code do?

Snippet c
int i = 1;
while(i <= 5){
    printf("Hi ");
    i++;
}
Opciones para What does this code do?

Pregunta 9

Which variable usually controls the while loop?

Opciones para Which variable usually controls the while loop?

Pregunta 10

What does this code print?

Snippet c
int i = 1;
int sum = 0;
while(i <= 3){
    sum += i;
    i++;
}
printf("%d", sum);
Opciones para What does this code print?

Pregunta 11

What does this code print?

Snippet c
int i = 2;
while(i <= 6){
    printf("%d ", i);
    i += 2;
}
Opciones para What does this code print?

Pregunta 12

What happens if you do not update the loop variable?

Opciones para What happens if you do not update the loop variable?

Pregunta 13

What does this code print?

Snippet c
int i = 3;
while(i > 3){
    printf("%d", i);
}
Opciones para What does this code print?

Pregunta 14

How many times does the while run?

Snippet c
int i = 0;
while(i < 4){
    i++;
}
Opciones para How many times does the while run?

Pregunta 15

What does this print?

Snippet c
int i = 1;
while(i < 4){
    printf("%d ", i);
    i++;
}
Opciones para What does this print?

Pregunta 16

What does this print?

Snippet c
int i = 1;
while(i <= 4){
    printf("%d ", i*2);
    i++;
}
Opciones para What does this print?

Pregunta 17

What does this print?

Snippet c
int i = 3;
while(i > 0){
    printf("%d ", i);
    i--;
}
Opciones para What does this print?

Pregunta 18

How many times does it run?

Snippet c
int i = 0;
while(i < 2){
    printf("C ");
    i++;
}
Opciones para How many times does it run?

Pregunta 19

What does this print?

Snippet c
int i = 1;
while(i <= 3){
    printf("%d ", i+1);
    i++;
}
Opciones para What does this print?

Pregunta 20

Which is a good practice when using while?

Opciones para Which is a good practice when using while?

Pregunta 21

What does this print?

Snippet c
int i = 0;
while(i < 3){
    printf("A ");
    i++;
}
Opciones para What does this print?

Pregunta 22

What does this print?

Snippet c
int i = 1;
while(i <= 2){
    printf("%d ", i);
    i++;
}
Opciones para What does this print?

Pregunta 23

What does this print?

Snippet c
int i = 2;
while(i <= 6){
    printf("%d ", i);
    i += 2;
}
Opciones para What does this print?

Pregunta 24

What does this print?

Snippet c
int i = 5;
while(i >= 3){
    printf("%d ", i);
    i--;
}
Opciones para What does this print?

Pregunta 25

What does this print?

Snippet c
int i = 1;
while(i < 3){
    printf("B ");
    i++;
}
Opciones para What does this print?

Pregunta 26

What does this print?

Snippet c
int i = 1;
while(i <= 3){
    printf("%d ", i*3);
    i++;
}
Opciones para What does this print?

Pregunta 27

What does this print?

Snippet c
int i = 4;
while(i > 1){
    printf("%d ", i);
    i--;
}
Opciones para What does this print?

Pregunta 28

How many times does it run?

Snippet c
int i = 1;
while(i <= 5){
    i++;
}
Opciones para How many times does it run?

Pregunta 29

What does this print?

Snippet c
int i = 0;
while(i < 2){
    printf("%d ", i+5);
    i++;
}
Opciones para What does this print?

Pregunta 30

What is the main purpose of while?

Opciones para What is the main purpose of while?

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