Thread: What is the problem with this one.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2016
    Posts
    6

    What is the problem with this one.

    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;
    Attached Images Attached Images What is the problem with this one.-untitled-jpg 

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-09-2014, 06:46 PM
  2. Problem passing argument into function, basic problem
    By tsdad in forum C++ Programming
    Replies: 7
    Last Post: 05-22-2013, 12:09 PM
  3. Replies: 1
    Last Post: 12-07-2012, 10:00 AM
  4. Replies: 4
    Last Post: 10-16-2008, 07:30 PM
  5. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 09:14 AM

Tags for this Thread