Program to find the length of a given string.
__________________________________
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i , char text[80];
cout<<"\nEnter the string(max=80) :";
gets(text);
for( i=0 ; text[i]!='0' ; i++ )
cout<<"\nThe length of the string is: " <<i ;
getch();
}
0 comments :