// Make a program that input user's name & prints its length
#include <stdio.h>
void printString(char arr[]);
int countLength(char arr[]);
int main() {
char name[100];
fgets(name, 100, stdin);//for taking input
printf("Length is : %d",countLength(name));
return 0;
}
int countLength(char arr[]){
int count=0;
for(int i=0; arr[i]!='\0';i++){
count++;
}
return count;// to get output
}
void printString(char arr[]){
for(int i=0; arr[i] !='\0' ;i++){
printf("%c",arr[i]);
}
printf("\n");
}
To embed this project on your website, copy the following code and paste it into your website's HTML: