Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Multiple if statement v0.8
//gcc 5.4.0 #include <stdio.h> int main(void) { printf("What is your age?\n"); int age; int price=100; double discount1=.15; double discount2=.10; double discount3=.05; double newprice1; newprice1=price-(price*discount1); double newprice2; newprice2=price-(price*discount2); double newprice3; newprice3=price-(price*discount3); scanf("%d",&age); if(age<=25) { printf("Your price is $%lf",newprice1); } else if(age==25) { printf("Your price is $%lf",newprice2); } else { printf("Your price is $%lf",newprice3); } }
run
|
edit
|
history
|
help
0
Intro to Arrays with comments
prime or not
Busqueda binaria version iterativa
day 3 integer manipulation
linux (mostly) true random number generator
funcion dar vuelta numero
a1
factorial
Random by thread
2.1.2 Sum of all the elements in a one dimensional array A using reduction.