fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[] = {1,2,3,4,5,6};
  5. int k = 2;
  6. int found = 0;
  7. for (int i=0;i<6;i++) {
  8. if (a[i]==k) {
  9. printf("Tim thay tai %d",i);
  10. found = 1;
  11. break;
  12. }
  13. }
  14. if (!found){
  15. printf ("khong tim thay\n");
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
Tim thay tai 1