You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
int findno(char str[]);
void main()
{
char str[100];
int n;
clrscr();
cout<<"Enter a string: ";
cin>>str;
n=findno(str);
cout<<"\n Number of characters in a string: "<<n;
getch();
}
int findno(char str[])
{
int n=0;
while(str[n]!='\0')
{
n++;
}
return(n);
}

You might also like