Kamis, 17 Maret 2016

Kasus 4.1 Perulangan sederhana



Algoritma:
·         Program membaca nilai yang tersimpan dalam variabel i;
·         Proses melakukan perulangan i empat kali
·         Cetak hasil perulangan.


#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 i;
                for (i=1; i<=4; i++){
                                cout<<i;
                }
                return 0;
}





Share:

0 komentar:

Posting Komentar