//Prog to input a string & print each word along with the number of characters present in the string.
#include
#include
#include
#include
void main()
{
clrscr();
int i,l,k=0,l1;
char a[90],b[90];
cout<
cout<<"Enter any string"<
gets(a);
strcat(a," ");
l=strlen(a);
for(i=0;i
{
if(a[i]!=' ')
{
b[k]=a[i];
k=k+1;
}
else
{
b[k]='\0';
cout<
l1=strlen(b);
cout<
k=0;
}
}
getch();
}
WHAT IS THE USE OF strcat(a," "); IN THIS PROG? what would have happend if it was not used? for which purpose is it used?
2007-01-06
02:20:53
·
3 answers
·
asked by
priya .
1
in
Programming & Design