i got this program i gotta write that reads in characters one at a time and print them out and i have to use the while loop. i tried all sorts of things but its not working. i think its the criteria im setting to get it matched is the problem. can any one help me. the code is below. by the way i hve to print out the characters in hex,octal,and decimal..
also it has to be simple code like only using the while loop and not arrays. im currently working on this if anyone can help me il appreciate it,
Code:
#include <stdio.h>
      9 int main()
     10 {
     11 char ch;
     12 fprintf(stdout,"Enter a character: ");
     13 while (fscanf(stdin,"%c", &ch)==1);
     14 {
     15 fprintf(stdout,"Character     Hex     Octal   Decimal \n");
     16 fprintf(stdout,"%c           %5x     %5o      %5d  \n",ch, ch, ch, ch);
     17 }
     18   return 0;
     19   }