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
Linked List
time clock and day count through second by user input (ratneshgujarathi)
PUNTEROS 1
fgets and basic string manipulation
FunPointUnion
double_buffer_madness
RadixSort
strcmp
WAP in C to print the reverse of a string
Date