Mega Code Archive

 
Categories / C / Language Basics
 

If command

#include <stdio.h> int main() {     float cost, tax, luxury, total;     luxury = 0.0;          printf("Enter the cost: ");     scanf("%f", &cost);          tax = cost * 0.06;     if( cost > 40000.0)         luxury = cost * 0.005;     total = cost + tax + luxury;          printf("the total cost is %0.2f", total); }