WELCOME TO MY BLOG @ UNIVERSITAS KRISNADWIPAYANA

Aritmetika Bilangan Bulat

//Aritmetika Bilangan Bulat Dengan Bahasa C
# include <stdio.h>

int main ()
{
  int bil1, bil2;

  printf("Masukan Bilangan Pertama?");
  scanf("%2dd", &bil1);
  printf("Masukan Bilangan Kedua?");
  scanf("%2d", &bil2);
  printf("%2d + %2d = %4d\n", bil1, bil2, bil1 + bil2);
  printf("%2d - %2d = %4d\n", bil1, bil2, bil1 - bil2);
  printf("%2d x %2d = %4d\n", bil1, bil2, bil1 * bil2);

  printf("%2d / %2d = ", bil1, bil2);
  (bil2 == 0)
    ? printf("tidak terhingga\n")
    : printf("%4d\n", bil1 / bil2);
  printf("%2d %% %2d = ", bil1, bil2);
  (bil2 == 0)
    ? printf("%4d\n", 0)
    : printf("%4d\n", bil1 % bil2);
  fflush(stdin); getchar();
  return 0;
}