C++ Array

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 26, 2016




langsung saya beri kodingannya ya, ini agak susah bagi pemula.





#include <iostream>

using namespace std;

main()
{
    int x[6],limit;
    char nama[6][20];
    char npm[6][20];


    cout<<"masukkan limit = ";
    cin>>limit;

    for(int a=0;a<=limit-1;a++)
    {
        cout<<"nama"<<a+1<<"=";
        cin>>nama[a];
        cout<<"npm"<<a+1<<"=";
        cin>>npm[a];
    }


    for(int a=0;a<=limit-1;a++)
    {
        cout<<nama[a];
        cout<<npm[a];
         cout<<endl;
    }

}


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed