Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Array pass effect
Deadlock
Multiples of 10 sum
B_141125_Burbuja
The endless numbers.
FILE Access 2
3-D array sum and search
WAP in C to print the reverse of a string
709 lab 3.2
b=1 c=1
Please log in to post a comment.