Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int maior1 (int a, int b, int c, int d) {
- if (a > b && a > c && a > d) {
- return a;
- }
- if (b > a && b > c && b > d) {
- return b;
- }
- if (c > a && c > b && c > d) {
- return c;
- }
- if (d > a && d > b && d > c) {
- return d;
- }
- }
- int main () {
- int a, b, c, d, maior;
- scanf ("%i %i %i %d", &a, &b, &c, &d);
- maior = maior1(a, b, c, d);
- printf ("maior = %i", maior);
- }
Add Comment
Please, Sign In to add comment