Program to illustrates strlen( ) function


#include <iostream.h>
#include <conio.h>
#include <string.h>          
void main( )
{
                     char s[ ] = "Hello";
cout<<" strlen ( "<<s<<" ) = "<<strlen(s) <<endl;
cout<<" strlen ( \"\" ) = "<<strlen("") <<endl;
char buff[20];
cout<<"Enter String : " ;
cin>>buff;
cout<<" strlen ( "<<buff <<" ) = "<<strlen(buff) <<endl;
getch( );              
}

No comments:

Post a Comment