Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {int x,y,m;
- float z;
- printf("Podaj dwie liczby \n");
- scanf("%d %d",&x,&y);
- printf("co chcesz zrobić? \n 1-dodawanie \n 2- odejmowanie \n 3- mnozenie \n 4- dzielenie \n") ;
- scanf("%d",&m);
- printf("\n");
- switch(m){
- case 1:z=x+y; break;
- case 2:z=x-y; break;
- case 3:z=x*y; break;
- default:if (y!=0) z=x/y;else printf("dzielnik wynosi zero"); break;
- }
- printf("wynik wynosi %f",z);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement