akbarbasya26

belajar looping dengan input

Nov 11th, 2019
154
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. main (){
  5. int b=0, nomor;
  6. for (int a=1; a <=10; a++){
  7. cout << "bilangan : "; cin >> nomor ;
  8. b = b + nomor ;
  9. }
  10. cout << "jumlah : " << b << endl;
  11.  
  12. }
RAW Paste Data