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
Lab 8 part 2 v.07
llist.h
20171116_PI
SAI_1-5.c
14th Dec Project1 v0.2
Project 3 part 2 Book v10.2
ptr_tp_ptr
sphere
Spring 2017 Project 2 v1
C code to compare two texts in form of array of chars ignoring the capitalization