Thread: Help with C programming Mathematical Calculations

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    3

    Help with C programming Mathematical Calculations

    I have been doing c programming for about 3 days now and am pretty confused as to why this is not working. It basically is asking to estimate the temp inside a freezer after a certain time (t) power outage...

    here is what i have so far, anyhelp is appreciated...

    [tag]
    Code:
    
    #include <stdio.h>
    int
    main(void)
    
    {
    
    	int time; /*time */
    	int temp; /* temperature */
    
    	
    	printf("EE233 Spring 2010, P1: Power Failure Freezer Temperature Estimate."); /*Greeting */ 
    	printf("How long (hours and minutes) since the power failure to the freezer?>"); 
    	scanf("%d", &time); 
                    temp = (4*(time*time)/( time +2))-20; /*Calculate the temperature */ 
    	printf("The estimated temperature inside your freezer is %d degrees Celsius.", temp ); 
    
    
    		
    		return (0);
    }
    [/tag]

    Not asking anyone to do this for me, just give me some hints on where to make this thing work...

    Thanks for any help.
    Last edited by StangFan; 01-13-2010 at 01:42 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 12-21-2009, 08:29 PM
  2. Mathematical Operation
    By madahmad1 in forum C Programming
    Replies: 29
    Last Post: 07-30-2008, 09:58 AM
  3. How do I get these calculations correct?
    By nadeni0119 in forum C++ Programming
    Replies: 10
    Last Post: 04-07-2003, 11:09 AM
  4. the definition of a mathematical "average" or "mean"
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 12-03-2002, 11:15 AM
  5. mathematical calculations
    By Unregistered in forum Windows Programming
    Replies: 7
    Last Post: 01-10-2002, 11:24 PM