Professional Documents
Culture Documents
Write A C Program To Find The Length of
Write A C Program To Find The Length of
#include <stdio.h>
void main()
{
char string[50];
int i, length = 0;
printf("Enter a string\n");
gets(string);
/*----------------------------------------------------
Output
Enter a string
hello
The length of a string is the number of characters in it
So, the length of hello = 5
RUN2
Enter a string
E-Commerce is hot now
The length of a string is the number of characters in it
So, the length of E-Commerce is hot now =21
----------------------------------------------------------*/