Advertisement
Angga_Wahyu

C++ Program While...If Sum

Oct 14th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int bil,hasil=0;
  6.     while (bil>0){
  7.         cout<<"Masukan Bilangan =";cin>>bil;
  8.     if (bil>0){
  9.         hasil+=bil;
  10.     }else
  11.     {
  12.     }
  13.     }cout<<hasil;
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement