type="text/javascript">

Sabtu, 29 Maret 2014

5.7 Figure 5.13 Nested Counting Loop Program

Program c++ nya :
 
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int a, b;
    cout<<"a\tb"<<endl;
    cout<<endl;
   
    for(a=1;a<4;++a){
        cout<<"Outer   "<<a<<endl;
    for(b=0;b<a;++b){
        cout<<"Inner   "<<b<<endl;
        }
        }
       
    system("PAUSE");
    return EXIT_SUCCESS;
}

#screenshot :
 

Tidak ada komentar:

Posting Komentar