This commit is contained in:
2024-01-22 14:41:15 +01:00
parent a00408d732
commit df2701109f
15 changed files with 110 additions and 71 deletions
+5 -5
View File
@@ -5,22 +5,22 @@
#include "for.h"
#include "stdio.h"
int for_cyklus(){
int for_cyklus() {
int target;
printf("Do akého čísla počítať?");
scanf("%d", &target);
printf("Zadal si číslo %d.\n", target);
printf("Cyklus FOR:\n");
for(int i = 0; i <= target; i++){
if(i % 2 == 1) {
for (int i = 0; i <= target; i++) {
if (i % 2 == 1) {
printf("%d\n", i);
}
}
printf("\nCyklus WHILE:\n");
int i = 0;
while(i <= target){
if(i % 2 == 1) {
while (i <= target) {
if (i % 2 == 1) {
printf("%d\n", i);
}
i++;