Advertisement
Mashudi

Bilangan Positif Negatif

Oct 14th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int x;
  7.         cout << "Masukkan Bilangan Bebas = "; //masukkan bilangan bulat positif atau negatif
  8.         cin >> x;
  9.         cout << "Bilangan Anda adalah " << x << ", maka Bilangan tersebut adalah = ";
  10.             if(x >= 0)
  11.             {
  12.                 cout << "Bilangan Positif";
  13.             }
  14.             else
  15.             {
  16.                 cout << "Bilangan Negatif";
  17.             }
  18.         cout << "\n";
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement