My issue
include <stdio.h>
int main(void) {
// your code goes here
char x[] = {'C','O', 'D','I', 'N', 'G'};
// Iterate through the array and print the index and the element
for (int i = 0; x[i] != '\0'; i++) {
printf("Index number %d\n", i);
printf("element %c\n", x[i]);
}
return 0;
}
what’s wrong ?
My code
#include <stdio.h>
int main(void) {
// your code goes here
char x[] = {'C','O', 'D','I', 'N', 'G'};
// Iterate through the array and print the index and the element
for (int i = 0; x[i] != '\0'; i++) {
printf("Index number %d\n", i);
printf("element %c\n", x[i]);
}
return 0;
}
Learning course: Learn C
Problem Link: CodeChef: Practical coding for everyone