This commit is contained in:
Саша 2025-09-23 23:21:36 +02:00
parent 04bd891ea0
commit 1eca04bc8b
2 changed files with 25 additions and 0 deletions

BIN
du1/program Executable file

Binary file not shown.

25
du1/program.c Normal file
View File

@ -0,0 +1,25 @@
#include <stdio.h>
int najti (char* pole, int size, char znak) {
for (int i = 0; i < size; i++) {
if (pole[i] < size) {
return i;
}
}
return -1;
}
int main() {
char text[] = "Zdarova Oleksandr!";
char hochunajti = 's';
int pozition = najti(text, sizeof(text), hochunajti);
if (pozition != -1) {
printf("Znak '%c' na %d", hochunajti, pozition);
} else {
printf("nebyla najdena poshol nahui");
}
return 0;
}