#include<stdio.h>
main()
{
char status;
printf("STATUS SYMBOL\n");
printf("------ ------\n");
printf("Senior s\n");
printf("Junior j\n");
while(1)
{
printf("Please Enter the Salesperson's Status : ");
scanf("%c",&status);
if (status=='s' || status=='j')
{
if(status=='s')
{
printf("Weekly Salary is --- $400\n");
break;
}
else
{
printf("Weekly Salary is --- $275\n");
break;
}
}
else
{
printf("Please Enter a Valid Symbol!\n");
}
}
}
When an Invalid data is entered,this program must ask user for a valid data.The While Loop used for validating the Data executing Two times,in order to ask the user for Input. Why the scanf function is being ignored on the First-Go? How to solve this Problem? Program Output