Tuesday, September 29, 2015

Character counting using while loop

#include <stdio.h>
#include <conio.h>

int main () {
int count=0;

printf ("type in a phrase\n");
while (getche()!='\r')
{
count++;
printf("in character count is %d\n",count);
}
getche ();
return 0;
}

No comments:

Post a Comment