C coding class
So I'm taking a Intro to C coding class, and my teacher want me to do a simple code for out hw.
the problem is that it's not calculating the price correctly, what is wrong with the code?
- - - Updated - - -
btw, Im righting the code and running it on a unix server
Code:
#include <stdio.h>
int main(void)
{
double orLbs;
int enerNum, yoNum;
double orPrice, ePrice, yPrice;
double tax = 0.065;
orPrice = orLbs*0.95;
ePrice = enerNum*1.5;
yPrice = yoNum*0.75;
printf("Lbs of Oranges? ");
scanf("%lf", &orLbs);
printf("Number of energy drinks? ");
scanf("%li", &enerNum);
printf("Item Cost Tax\n");
printf("Orange %.2f\n", orPrice);
printf("Energy Drinks %.2f %.2f\n", ePrice, ePrice*tax);
}
- - - Updated - - -
btw, Im righting the code and running it on a unix server
