It was a question to simply compare and reward the user according to input provided. I tried to improvise it a bit but it is not executing properly. Kindly provide me the insights about this code.
void main()
{
char sci,math;
/*printf("Disclaimer: 1 for Yes, 0 for No \n");*/
printf("Did you passed maths? (y/n) \n");
scanf(" %c",&math);
printf("Did you passed science? (y/n) \n");
scanf(" %c",&sci);
if(math=="y" && sci=="y")
{
printf("Congratulations!! You have been awarded Rs.45 \n");
}
else if(math=="y" && sci=="n")
{
printf("Congratulations!! You have been awarded Rs.15 \n");
}
else if(math=="n" && sci=="y")
{
printf("Congratulations!! You have been awarded Rs.10 \n");
}
else
{
printf("Sorry No awards better luck next time \n");
}
getchar();
}