Rabu, 06 April 2016

contoh do while


#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
    int nilai=10;
    do{
        cout<<"Total = "<<nilai<<endl;
        nilai++;
    }
    while (nilai<5);
    cout<<"Bye...";
   
    return 0;
}

Tidak ada komentar:

Posting Komentar