Programacion mini problemas Flashcards

1
Q

for ( int i = 0 ; i > 5 ; i++)

   cout << i <<  " " ;
A

no despliega nada, nunca entra al ciclo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

for ( int i = 0 ; i < = 10 ; i+2)

   cout << i <<  " " ;
A

0, 0, 0, 0

es un ciclo infinito, i no cambia valor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

for ( int i = 0 ; i < 5 ; i++)

   cout << i <<  " " ;
A

0, 1, 2, 3, 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

for ( int i = 1 ; i < 5 ; i++)

   cout << i <<  " " ;
A

1, 2, 3, 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

int res;

for ( int i = 1 ; i < = 5 ; i++)

   { res=i*2+1;

      cout << res<<  " " ;

     }
A

3, 5 (7, 9, 11)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

int res;

for ( int i = 1 ; i < = 5 ; i++)

   {res=i*2+1;

     }

     cout << res<<  " " ;

     ------------------------------------
A

11

porque el cout lo muestra al finalizar el ciclo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

for ( int i = 1 ; i < = 5 ; i++)

   {cout<< "hola"
A

hola hola hola hola hola 6

i 5 se suma 1, siendo 6 y ya no entra al ciclo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

cont = 0;

for (int i=0 ; i < 5 ; i++)

  {cont=cont+2;

   cont=cont+1; }

cout

A

cout es 15

(3, 6, 9, 12) 15

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

for ( int i = 2 ; i < = 7 ; i++)

   {cout<< "hola"
A

hola(2), hola(3), hola(4), hola(5), hola(6),hola(7) , 8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly