Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int value, total;
  2. double carval=55.0, truckval=65.0, vanval=60.0, othersval=70.0;
  3. printf("Enter value, 1=car, 2=truck, 3=van\n");
  4. scanf("%d", &value);
  5. switch(value)
  6. {
  7.    case 1:
  8.         total=carval;
  9.         break;
  10.  
  11.    case 2:
  12.       total=truckval;
  13.       break;
  14.  
  15.    case 3:
  16.       total=vanval;
  17.       break;
  18.  
  19.    default:
  20.       total=othersval;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement