Sunday, May 26, 2013

Pemrograman C++ Pengulangan for

Video :



Source code : 
// Modul 6-3.cpp : Defines the entry point for the console application
// Nama : Ulil Albab
// NIM : 49013033
// ===================================================================

#include "stdafx.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
 cout << "PENGULANGAN MENAIK" << endl;
 for(int C = 0; C < 10; C++) {
  cout << C + 1 << endl;
 }

 cout << '\n';
 cout << "PENGULANGAN MENURUN" << endl;
 for(int D = 10; D > 0; D--) {
  cout << D << endl;
 }

 system("pause");
 return 0;
}

No comments:

Post a Comment