Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- #include<conio.h>
- #include<stdlib.h>
- int dodaj(int,int);
- int odejmij(int,int);
- int mnozenie(int,int);
- float dzielenie(float,float);
- void wybor(char *);
- int main(){
- int a,b;
- char x,y;
- for(;;){
- printf("Podaj operacje arytmetyczna:");
- x=_getch();
- switch(x){
- case'+':
- printf("\nPodaj 1 liczbe: ");
- scanf_s("%d",&a);
- printf("Podaj 2 liczbe: ");
- scanf_s("%d",&b);
- printf("%d+%d=%d",a,b,dodaj(a,b));
- break;
- default: printf("Nieznana opcja");exit(0);
- }
- getchar();getchar();
- system("cls");
- }
- return 0;
- }
- int dodaj(int a,int b){
- return a+b;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement