add_while_loop
This commit is contained in:
parent
125e6c9af3
commit
9a2d9f07eb
13
for.c
13
for.c
@ -7,11 +7,18 @@
|
||||
|
||||
int for_cyklus(){
|
||||
int target;
|
||||
|
||||
|
||||
printf("Do akého čísla počítať?");
|
||||
scanf("%d", &target);
|
||||
|
||||
for(int i = 1; i <= target; i++){
|
||||
printf("Zadal si číslo %d.\n", target);
|
||||
printf("Cyklus FOR:\n");
|
||||
for(int i = 0; i <= target; i++){
|
||||
printf("%d\n", i);
|
||||
}
|
||||
printf("Cyklus WHILE:\n");
|
||||
int i = 0;
|
||||
while(i <= target){
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user