Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
bitmask shift
CO_assign_q4
Test 2
Switch
20171117_PITAGORAS
bit wise operation
binary to txt
Project 3 Part 1 v1.7
14th Dec Project1 v0.5
Character testing
Please log in to post a comment.