Lecture 127
// Loop do while
#include <iostream>
#include <conio.h>
using namespace std;
main ()
{
char ch;
int count=0;
cout<<"Type ina phrase : \n";
do
{
cout<<ch;
count++;
}while((ch=getch())
!= '\r');
cout<<" \n\nCharacter count is :
"<<count;
getch();
return 0;
}
Code view in dev compiler:
Compile the program Ctrl+F9
Run program Ctrl+F10