-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaula14.cpp
More file actions
54 lines (37 loc) · 942 Bytes
/
aula14.cpp
File metadata and controls
54 lines (37 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
using namespace std;
int main(){
//laço while, quando não conhece condição de parada; numero de vezes a ser repetido é indeterminado
/*
while(expressao){
comandos
}
*/
/*
int n;
n=0;
while(n<10){
cout << n << "\n";
//n++; //concede uma condição de parada
cin >> n; //pode ser recebendo do teclado
}
*/
/*
int cont;
cont=0;
while(cont<20){
cout << cont << "\nI will not copy code without understanding it";
cont++; //condição de parada ou de dois em dois 'cont+=2' (suscessivamente)
}
*/
int cont;
cont=0;
while(cont++<20){//incremento para condição de parada
cout << cont << "\n" << "I will not copy code without understanding it - ";
if(cont == 10) {
break;
}
}
cout << "\nRotina finalizada\n";
return 0;
}