Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Assignment 5
#include <stdio.h> int main (void) { double gallon=21.0; double gallonPrice; char name; scanf("%s", &name); if (gallon <= 30 ) { gallonPrice=0.20*gallon; printf("The price of the gallon is %lf", gallonPrice); } if else(gallon <= 60) { gallonPrice=.50*gallon; printf("The price of the gallon is %lf", gallonPrice); } if else(gallon <= 99) { gallonPrice=.80*gallon; printf("The price of the gallon is %lf", gallonPrice); } if else(gallon >= 100) { gallon=.50*gallon; printf("The price of the gallon is %lf", gallonPrice); } return 0; printf("Dear %s,\n", name); printf("The price in total is %lf\n", %gallonPrice); printf("The amount of gallons you have consumed is %lf", gallon); printf("customer ID is 68461"); }
run
|
edit
|
history
|
help
0
150114_MatrizSumaPerimetro
C_141127_MatrizProducto
implicit parameter type
Replacing Evens and Odd with ones and zeroes in a 3-Dimensional array
3468
Square pyramid
A_141117_Primo02
18BCE2182 ASSESS_3 Q2
-Wall
Basic String Compression in C