// count number of characters entered
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int count=0;
const char ent=’\n’;
char ch;
cout<<”enter character\n”;
cin.get(ch);
while(ch!=ent)
{
count++;
cout.put(ch);
cin.get(ch);
}
cout<<”\n the number of characters=”<<count<<”\n”;
getch();
}
No comments:
Post a Comment