Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Assignment 5 v2
#include <stdio.h> int main (void) { double gallon=21.0; double gallonPrice; char name[20]; scanf("%s", &name); if (gallon <= 30 ) { gallonPrice=0.20*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon <= 60) { gallonPrice=0.50*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon <= 99) { gallonPrice=0.80*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } else if(gallon >= 100) { gallonPrice=0.50*gallon; printf("The price of the gallon is %lf\n", gallonPrice); } printf("Dear %s,\n", name); printf("The price in total is %lf\n", gallonPrice); printf("The amount of gallons you have consumed is %lf\n", gallon); printf("customer ID is 68461\n"); return 0; }
run
|
edit
|
history
|
help
0
WAP in C to print the reverse of a string
tremendo codigaso ayudantia
SEGUNDO AVANCE DE NETFLIX
Project 4 v1.1
-Wall
150109_RecursividadParImpar
A_141212_HistoriaDePunteros
Matriz funcona medio raor aslñdk
ptr_to_ptr
Spring 2017 Project 2 v1.6