fork download
  1. #include <stdio.h>
  2.  
  3. int main(void){
  4. char text[] = "een stuk text";
  5. char letter = 'k';
  6. int i, foundIt = 0;
  7.  
  8. for ( i = 0; text[i] != '\0'; i++ ){
  9. if( (foundIt = (text[i] == letter)) )
  10. break;
  11. }
  12. if(foundIt)
  13. printf("%d\n", i);
  14. else
  15. printf("Not found.\n");
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
7