golovanovd

prog_lab_2.2

Feb 6th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. /*
  2. 1- сброс
  3. 2 - сложить
  4. 3 - вычесть
  5. 4 - умножить
  6. 5 - делить
  7. 6 - ctg
  8. 7 - |x|
  9. 8 - x^3
  10. */
  11. #include <stdio.h>
  12. #include "math.h"
  13. int main (void) {
  14.     int oper;
  15.     float a, res;
  16.     printf("1st Number: ");
  17.     scanf("%f", &a);
  18.     printf("\nOperation: ");
  19.     scanf("%i", &oper);
  20.     while(true) {
  21.         printf("\nNumber: ");
  22.        
  23.         switch(oper) {
  24.             case 1: res=0; break;
  25.             case 2:
  26.             case 3:
  27.             case 4:
  28.             case 5:
  29.             case 6:
  30.             case 7:
  31.             case 8:
  32.             case 9: return 0;
  33.         }
  34.     }
  35. }
Add Comment
Please, Sign In to add comment