Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- float x, y;
- printf("x="); scanf("%f", &x);
- printf("y="); scanf("%f", &y);
- puts("1)max dintre x si y");
- puts("2)min dintre x si y");
- puts("3)x");
- puts("4)y");
- int opt;
- printf("option="); scanf("%d", &opt);
- if (opt == 1) {
- if (x > y) {
- printf("%f", x);
- } else {
- printf("%f", y);
- }
- } else if (opt == 2) {
- if (x > y) {
- printf("%f", y);
- } else {
- printf("%f", x);
- }
- } else if (opt == 3) {
- printf("%f", x);
- } else if (opt == 4){
- printf("%f", y);
- }
- puts("");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement