SHARE
TWEET

Untitled

a guest Jun 18th, 2019 60 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;
  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.     maksimum(a,b,c);
  17.     getche();
  18. }
  19. int maksimum(int a,int b,int c)
  20. {
  21.    
  22.     if ((a>b) && (b>c))
  23.         printf("nilai maksimum : %d",a);
  24.     else if ((b>c) && (c>a))
  25.         printf("nilai maksimum : %d",b);
  26.     else
  27.         printf("nilai maksimum : %d",c);
  28.     return(a,b,c);
  29.     getche();
  30. }
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