Advertisement
Carnby1021

Untitled

Mar 14th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. #include<conio.h>
  4. #include<stdlib.h>
  5.  
  6. int dodaj(int,int);
  7. int odejmij(int,int);
  8. int mnozenie(int,int);
  9. float dzielenie(float,float);
  10. void wybor(char *);
  11.  
  12. int main(){
  13. int a,b;
  14. char x,y;
  15. for(;;){
  16. printf("Podaj operacje arytmetyczna:");
  17. x=_getch();
  18.  
  19. switch(x){
  20. case'+':
  21. printf("\nPodaj 1 liczbe: ");
  22. scanf_s("%d",&a);
  23. printf("Podaj 2 liczbe: ");
  24. scanf_s("%d",&b);
  25. printf("%d+%d=%d",a,b,dodaj(a,b));
  26. break;
  27. default: printf("Nieznana opcja");exit(0);
  28. }
  29. getchar();getchar();
  30. system("cls");
  31. }
  32. return 0;
  33. }
  34.  
  35. int dodaj(int a,int b){
  36. return a+b;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement