fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int angka;
  6. cout << "Masukkan sebuah angka: ";
  7. cin >> angka;
  8.  
  9. if (angka > 0)
  10. cout << "Angka positif" << endl;
  11. else if (angka < 0)
  12. cout << "Angka negatif" << endl;
  13. else
  14. cout << "Angka nol" << endl;
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Masukkan sebuah angka: Angka positif