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