Minggu, 27 Januari 2013

C++ : Program Mencari Nilai Maksimal dalam Matriks


Di Bawah ini adalah listing program untuk mencari nilai maksimal dalam matriks.

Listignya :
#include<iostream.h>
#include<conio.h>
void main()
{
                int matriks [4][4];
                int ikolom, ibaris;
                int maks = -1000;
                int i ,j;
                cout<<"Isi Data Matriks"<<endl;
                for(i=1; i<=4; i++)
                {
                                for(j=1; j<=4; j++)
                                {
                                                cout<<"Matriks ["<<i<<"]["<<j<<"] : ";
                                                cin>>matriks[i][j];
                                                {
                                                                if (matriks[i][j] > maks)
                                                                {
                                                                                maks = matriks[i][j];
                                                                                ibaris = i;
                                                                                ikolom = j;
                                                                }
                                                }
                                }
                }
                cout<<"Matriks"<<endl;
                for(i=1; i<=4; i++)
                {
                                for(j=1; j<=4; j++)
                                {
                                                cout<<matriks[i][j]<<" ";
                                }
                                cout<<endl;
                }
                cout<<"Nilai Maksimal : "<<maks<<endl;
                cout<<"Baris ke ["<<ibaris<<"] Kolom ke ["<<ikolom<<"]"<<endl;
                cout<<endl;
                getch();
}

Outputnya :


Artikel Terkait :

Bagikan :

2 komentar:

  1. Selamat datang di intanqq

    Ayo bergabung bersama kami, tersedia 7 permainan dalam 1 ID:
    - Sakong (New Game)
    - Bandar Poker (New Game)
    - BandarQ (Hot Game)
    - Poker
    - Domino
    - Capsa Online
    - AduQ

    Apa kelebihan bermain di intanqq? Berikut kelebihannya:
    - BONUS TURNOVER 0.3% SETIAP HARI
    - BONUS XTRA TURNOVER SETIAP MINGGUNYA
    - BONUS REFERAL 10% +10% SEUMUR HIDUP!!
    - MIN DEPO IDR 15.000 dan Proses super cepat 1 menit.
    - Bisa dimainkan di Smartphone Versi Android dan Iphone.
    - Win rate 98%
    - No robot
    - Fair play 100% player vs player

    Tunggu apalagi? Ayo segera bergabung sebelum ketinggalan promonya :)

    bandarq
    dominoqq
    domino99 online terpercaya
    Domino Qiu Qiu
    dominoqq

    BalasHapus
  2. Selamat datang di intanqq

    Ayo bergabung bersama kami, tersedia 7 permainan dalam 1 ID:
    - Sakong (New Game)
    - Bandar Poker (New Game)
    - BandarQ (Hot Game)
    - Poker
    - Domino
    - Capsa Online
    - AduQ

    Apa kelebihan bermain di intanqq? Berikut kelebihannya:
    - BONUS TURNOVER 0.3% SETIAP HARI
    - BONUS XTRA TURNOVER SETIAP MINGGUNYA
    - BONUS REFERAL 10% +10% SEUMUR HIDUP!!
    - MIN DEPO IDR 15.000 dan Proses super cepat 1 menit.
    - Bisa dimainkan di Smartphone Versi Android dan Iphone.
    - Win rate 98%
    - No robot
    - Fair play 100% player vs player

    Tunggu apalagi? Ayo segera bergabung sebelum ketinggalan promonya :)

    bandarq
    dominoqq
    domino99 online terpercaya
    Domino Qiu Qiu
    dominoqq

    BalasHapus