input a character, 'q' for quit: a <先問一條問題
the character you typed is a
input a character, 'q' for quit: b <如何返回開始再問同一條問題?
the character you typed is b
input a character, 'q' for quit: 1 <如是者, 繼續問
the character you typed is 1
input a character, 'q' for quit: q <直接打到答案先出現QUIT
the character you typed is q
QUIT!
小弟試過用switch 但只出一次, 就while loop又唔知點整
小弟係初哥 應該點做??
更新1:
actually I write in Dev-C++, but I save file in '.c' . as i write in 'do-while', the output does not like the above. it repeats 'input a character, 'q' for quit: the character you typed is' between the next asking.
更新2:
I write like this: do { printf("Please input a character and then ,'q' for quit:"); scanf("%c", &character); printf("The character you typed is [%c]\n\n", character); }while(character!='q'); printf("The program quits, as you wanted...");