Program to find the length of the given string
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
char str[80];
int i;
clrscr();
printf("Enter the string : ");
gets(str);
for(i = 0; str[i] != '\0'; i++);
printf("\nThe length of the string is : %d", i);
getch();
}
Output:
Enter the string : welcome
The length of the string is : 7
-
UpdatedDec 31, 2019
-
Views4,667
You May Like
Program to maintain employee details using structures
Program to maintain student details using structures
Check whether the person is eligible to vote or not
Print the numbers that are divisible by a given no.
Program to generate magic square
To sort the given numbers in ascending & descending order