it crashes when input special type of delivery
Code:
#include <stdio.h>
int main()
{
float total_words,total;
char t[50],deliv;
printf("Enter Customer's Name: ");
scanf("%s",t);
printf("Input Number Of Words Used In The Telegram: ");
scanf("%f",&total_words);
if(total_words>12)
{
total = 28.99+(2.5*(total_words-12));
}
else if(total_words<12)
{
total = 28.99;
}
printf("Input type of delivery (S-Special) or (N-None): ");
scanf("%c",deliv);
if( deliv == 's' && deliv == 'S')
{
total = total + 5;
}
printf("Total cost: %f", total);
return 0;