SHARE
TWEET

Untitled

a guest Jun 18th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int maksimum(int a,int b,int c);
  5.  
  6. void main()
  7. {
  8.     int a,b,c,max;
  9.     printf("Menghitung Nilai Maksimum dari 3 buah bilangan\n");
  10.     printf("input bilangan ke-1 : ");
  11.     scanf("%d",&a);
  12.     printf("input bilangan ke-2 : ");
  13.     scanf("%d",&b);
  14.     printf("input bilangan ke-3 : ");
  15.     scanf("%d",&c);
  16.     max = maksimum(a,b,c);
  17.     printf("nilai maksimum : %d", max);
  18.     getche();
  19. }
  20. int maksimum(int a,int b,int c)
  21. {
  22.     if ((a>b) && (b>c))
  23.         return a;
  24.     else if ((b>c) && (c>a))
  25.         return b;
  26.     else
  27.         return c;
  28.     getche();
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top