-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.cpp
More file actions
53 lines (39 loc) · 984 Bytes
/
loop.cpp
File metadata and controls
53 lines (39 loc) · 984 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
#include <iostream>
#include <string>
using namespace std;
int main ()
{
//switch case (only for equality test) :
int numberOfPlayers(2);
switch (numberOfPlayers) //name of the variable to work with
{
case 0:
cout << "azertyuiop" << endl; //action to realise
break; //break
case 1:
cout << "azertyuiop" << endl;
break;
case 2:
cout << "azertyuiop" << endl;
break;
default: //default case (ultimate case if no one on top is executed)
cout << "azertyuiop" << endl;
break;
}
//for loop :
int test = 5;
for(int i = 0; i < test; i++)
{
cout << test << endl;
}
//while loop :
int j = 10;
int k = 0;
while (k < j)
{
cout << "hello" << endl;
k++;
}
/* ==, &&,!= like in C langage or and, or, not */
return 0;
}