I'm writing a small program which asks a user to input 6 numbers.
It then displays it on the screen..
(*)Then, it asks the user again if he wants to input any more numbers..
If the user enters 'y'..he can input another 6 numbers..this goes on and on until he enters 'n' for the question in (*) and the program will end..
below is the code
Code:
int u_num[6];
char answer;
int count=0;
do
{
printf("Please input any six numbers (from 1 to 40) \n");
for (i=0; i<6; i++)
{
scanf("%d", &u_num[i]);
}
printf(" Your Numbers are:");
for (i=0; i<6; i++)
{
printf(" --%d--", u_num[i]);
}
printf("\n\n Do you want to input any more number? \n\n");
scanf("%c", &answer);
}
while(answer!='n');
}
The problem that is occurring is that I'm getting the message
"Please insert your 6 numbers" along with
"Do you want to input any more??"
[Refer to attachment]
I just want this "Do you want to input any more??" to be displayed..
Any help or suggestion???