#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
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to print length of a given string
———————————————————————————————————————————
Enter the string KODINGWINDOW
Length of string is 12
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.