// length of string using for loop
#include <stdio.h>
#include<string.h>
int main() {
char a[20];
int i,l=0;
scanf("%[^\n]%*c",a);
for(i=0;a[i]!='\0';i++){
printf("%c",a[i]);
if(a[i]!=EOF){
l++;
}
}
printf("\nLength of string : %d",l);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: