Creating a Matrix Using Turbo/Borland C++

Now we try to make a Matrix 3 x3 using Turbo/borlan C++. In C/C++, we use array algorithm for creating a matrix. Open Turbo/Borland C++, create new “cpp” file, type code like this:

Remember, if we use function ‘cout’ we must type at the header #include<iostream.h>. Look at carefully line int A[3][3]={1,2,3,4,5,6,7,8,9};. It means that we create a matrix 3×3 similar to matrix in matlab:

A=[1 2 3;4 5 6;7 8 9]

Loops ‘for’ at that code are only for showing the content of array/matrix A[3][3]. Try code for create matrix interactively using keyboard input. Use function ‘cin’ and loops ‘for’ for positioning the element of matrix.

Penulis: rahmadya

I'm a simple man .. Lahir di Sleman Yogyakarta, 7 Juni 1976 TK : - (tidak ada TK di tj Priok waktu itu) SDN : Papanggo, Jakarta 83 - 89 SMPN : 129, Jakarta 89 - 92 SMAN : 8, Yogyakarta 92 - 95 Univ. : Fak. Teknik UGM, Yogyakarta 95 - 2001 Pasca. : Tek. Informatika STMIK Nusa Mandiri, Jakarta 2008 - 2010 Doctoral : Information Management Asian Institute of Technology, Thailand 2013 - 2018 Pekerjaan: Tek. Komputer AMIK BSI Jakarta : 2002 - 2005 IT Danamon Jakarta : 2005 - 2008 Tek. Informatika STMIK Nusa Mandiri Jakarta : 2005 - 2008 Univ. Darma Persada : 2008 - Skrg Fakultas Teknik Universitas Islam "45" Bekasi : 2008 - Skrg ( Homebase)

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.