I am really confused as why when I assign payment option for char value of this code to and it is it not taking as char input.I have tried to change my code to few methods but none of those fix my problem.
#include<stdio.h>
int main(){
char Ptype;
char Rtype;
int noRoom;
int noNight;
int noRooms;
float total;
char ch;
printf("Please enter the room type\n");
scanf("%c",&Rtype);
if(Rtype =='D' || Rtype == 'd'){
printf("Please Enter the no of night ");
scanf("%d",&noNight);
printf("Please Enter the no of room ");
scanf("%d",&noRooms);
printf("Please enter the paying method");
scanf("%c",&Ptype); // input is not taking as char
if(Ptype=='M' || Ptype == 'N'){
total=noNight*5000;
printf("%fTotal amount is", total );
}
else if (Rtype=='c' || Rtype == 'C'){
total=noNight*5000*0.10;
printf("%fTotal amount is", total);
}}
return 0;
}