while not
This commit is contained in:
parent
20158b8dc1
commit
6b74662521
1 changed files with 18 additions and 0 deletions
18
semaine-2/while-not/main.c
Normal file
18
semaine-2/while-not/main.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
|
||||||
|
char mot[] = "Un ordinateur peut entre autre effectuer des taches "
|
||||||
|
"repetitives sans se lasser et sans se tromper, enfin..., si le "
|
||||||
|
"developpeur a bien fait son travail.";
|
||||||
|
int i = 0, length = strlen(mot);
|
||||||
|
|
||||||
|
while (mot[i] != ',' && i < length) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%i", i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue