#include<stdio.h>
#include<string.h>intmain(){chars[50];printf("———————————————————————————————————————————");printf("\nProgram to print length of a given string");printf("\n———————————————————————————————————————————");printf("\nEnter the string ");scanf("%s",s);intl=strlen(s);printf("\nLength of string is %d",l);printf("\n———————————————————————————————————————————\n");return0;}
Output
godarda@gd:~$ gcc gd.c godarda@gd:~$ ./a.out
———————————————————————————————————————————
Program to print length of a given string
———————————————————————————————————————————
Enter the string KODINGWINDOW
Length of string is 12
———————————————————————————————————————————
godarda@gd:~$
Dear User, Thank you for visitng GoDarda. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.