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
swap_bitwise.c
Print Micro Seconds
square pyramid
Función quicksort decreciente
Loop practice
main.c
prime numbers using functions
Day 2 String Manipulation
Random by thread
InterviewDesk_Embedded