+ 1

please help me to find the error in this C code

I am a beginner to c language. Please help me to find the error of the code. #include <stdio.h> #include <string.h> void main() { char i; char arr[23]; printf("Enter your name? \n");` scanf("%c",&arr[i]); for(int v=0;v<=strlen(arr);v++) { printf("%c",arr[v]); } }

3rd Apr 2020, 8:16 AM
Geethma Rathnayake
2 ответов
+ 1
scanf("%s",arr); will be enough to get a string
3rd Apr 2020, 8:26 AM
சுவேகா
சுவேகா - avatar