I was trying to enter character in c using scanf, more thn once but it didnt work:( . I am beginner so plz dont mind if this is a silly question.
here is the code:
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
do
{
printf("enter y");
scanf("%c",&ch);
}while(ch=='y');
getch();
}
i want the program to continue if y is entered........ but it takes character value only once........
plz tell me what to do.................
I WANT TO DO IT USING SCANF() AND NOT GETCHE().........
thanku
Edited by Roger, 04 December 2011 - 08:34 AM.
added code tags


Sign In
Create Account

Back to top









