Here is a code not working because of "do" command
Please what's wrong why I can't compile it ?Code:#include <stdio.h>
#include <stdlib.h>
int main()
{
int count_a = 0, count_e = 0, count_o = 0, count_i = 0, count_u = 0;
char ch;
do
{
ch = getche();
switch (ch)
{
case'a':count_a++;
break;
case'e':count_e++;
break;
case'o':count_o++;
break;
case'i':count_i++;
break;
case'u':count_u++;
break;
}
printf("\n a exist %d times", count_a);
printf("\n e exist %d times", count_e);
printf("\n o exist %d times", count_o);
printf("\n i exist %d times", count_i);
printf("\n u exist %d times", count_u);
}
I'm using codeblocks and microsoft visual 2015. Thank you.
and please don't answer like open a book and read again.. thanks