fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char d[50];
  5. int i = 0;
  6.  
  7. // Read a string from input
  8. scanf("%s", d);
  9.  
  10. // Iterate through the string
  11. while (d[i] != '\0') {
  12. printf("d[%d]=%c->%d\n", i, d[i], d[i]);
  13. i++; // Increment the index
  14. }
  15.  
  16. return 0; // Corrected return statement
  17. }
Success #stdin #stdout 0.01s 5276KB
stdin
okabe_kou
stdout
d[0]=o->111
d[1]=k->107
d[2]=a->97
d[3]=b->98
d[4]=e->101
d[5]=_->95
d[6]=k->107
d[7]=o->111
d[8]=u->117