Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1.     do {
  2.        
  3.         //Prints the meny
  4.         printf("1. Set exchange rate in SEK (current rate: %.2f)\n", exchangeRate);
  5.         printf("2. Read prices in the foreign currency\n");
  6.         printf("3. End\n\n");
  7.  
  8.  
  9.         printf("Give your choice (1 - 3): ");  
  10.         scanf("%hd", &choice);
  11.         printf("\n");
  12.  
  13.         switch(choice) {
  14.  
  15.             case 1 :
  16.  
  17.                 break;
  18.  
  19.             case 2 : ;     
  20.                 //Counts the total forign sum given until the price is negative
  21.  
  22.                 break;
  23.  
  24.             case 3 :
  25.                 printf("End of program!\n\n");
  26.                 break;
  27.  
  28.             default :
  29.                 //If a non valid number is given
  30.  
  31.                 break;
  32.         }
  33.     } while (choice != 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement