Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- while (1) {
- puts("1)adunare");
- puts("2)scadere");
- puts("3)inmultire");
- puts("4)impartire");
- puts("5)exit");
- int opt;
- printf("option="); scanf("%d", &opt);
- if (opt == 5) {
- break;
- }
- float x, y;
- printf("x="); scanf("%f", &x);
- printf("y="); scanf("%f", &y);
- float res;
- if (opt == 1) {
- res = x + y;
- } else if (opt == 2) {
- res = x - y;
- } else if (opt == 3) {
- res = x * y;
- } else if (opt == 4) {
- res = x / y;
- }
- printf("raspuns=%g\n\n", res);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement