Friday, 23 November 2012

Program C++ mencari nilai maximal


#include <stdio .h>

int main (void) {
 int a, b, c, max;

 printf ("masukkan 10 bilangan : ");
 scanf("%d%d%d", &a, &b, &c);



 max = a ;
 if(b > max)
  max = b ;

 if (c > max)
  max =c;

 printf ("nilai terbesar : %d\n", max);

 return 0;
 }

Reactions:

0 comments:

Post a Comment