#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
char stm[100];
cout<<"Enter string:";
gets(stm);
int i,s=0,l=0;
for(i=0;stm[i]!=NULL;i++)
{
if(stm[i]==' ')
s++;
if(stm[i]=='.')
l++;
}
cout<<"Total number of:\nWords="<<s+1<<"\nLines="<<l;
getch();
clrscr();
}
#include<conio.h>
#include<stdio.h>
void main()
{
char stm[100];
cout<<"Enter string:";
gets(stm);
int i,s=0,l=0;
for(i=0;stm[i]!=NULL;i++)
{
if(stm[i]==' ')
s++;
if(stm[i]=='.')
l++;
}
cout<<"Total number of:\nWords="<<s+1<<"\nLines="<<l;
getch();
clrscr();
}
No comments:
Post a Comment