Enviar pesquisa
Carregar
3 matrix in c++ programming aramse
•
0 gostou
•
364 visualizações
Aram SE
Seguir
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 16
Baixar agora
Baixar para ler offline
Recomendados
Cours de C++, en français, 2002 - Cours 1.3
Cours de C++, en français, 2002 - Cours 1.3
Laurent BUNIET
Programs
Programs
Murali Kummitha
Programs
Programs
Murali Kummitha
ملزمة الرياضيات لشيخ الرياضيات - كامل موسى الناصري
ملزمة الرياضيات لشيخ الرياضيات - كامل موسى الناصري
Online
طريقة عمل ايميل ياهو
طريقة عمل ايميل ياهو
Mahmoud Tamous
Via int. club romania 2
Via int. club romania 2
AmalieFrom
2 arrays in c++ programming aramse
2 arrays in c++ programming aramse
Aram SE
تحميل برنامج معرفة مواصفات الكمبيوتر
تحميل برنامج معرفة مواصفات الكمبيوتر
Mahmoud Tamous
Recomendados
Cours de C++, en français, 2002 - Cours 1.3
Cours de C++, en français, 2002 - Cours 1.3
Laurent BUNIET
Programs
Programs
Murali Kummitha
Programs
Programs
Murali Kummitha
ملزمة الرياضيات لشيخ الرياضيات - كامل موسى الناصري
ملزمة الرياضيات لشيخ الرياضيات - كامل موسى الناصري
Online
طريقة عمل ايميل ياهو
طريقة عمل ايميل ياهو
Mahmoud Tamous
Via int. club romania 2
Via int. club romania 2
AmalieFrom
2 arrays in c++ programming aramse
2 arrays in c++ programming aramse
Aram SE
تحميل برنامج معرفة مواصفات الكمبيوتر
تحميل برنامج معرفة مواصفات الكمبيوتر
Mahmoud Tamous
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
Aram SE
Business in russia
Business in russia
AmalieFrom
1 borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
Aram SE
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
Aram SE
TFG BUFF
TFG BUFF
cocarroideceba
85
85
cocarroideceba
TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA
cocarroideceba
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
Aram SE
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
Aram SE
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
Aram SE
Controle automatico de_processos
Controle automatico de_processos
William Andrade
Access lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access Basics
Aram SE
Easiest way to start with Shell scripting
Easiest way to start with Shell scripting
Akshay Siwal
Breakfast club oktober 2013
Breakfast club oktober 2013
AmalieFrom
Mais conteúdo relacionado
Destaque
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
Aram SE
Business in russia
Business in russia
AmalieFrom
1 borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
Aram SE
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
Aram SE
TFG BUFF
TFG BUFF
cocarroideceba
85
85
cocarroideceba
TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA
cocarroideceba
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
Aram SE
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
Aram SE
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
Aram SE
Controle automatico de_processos
Controle automatico de_processos
William Andrade
Access lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access Basics
Aram SE
Easiest way to start with Shell scripting
Easiest way to start with Shell scripting
Akshay Siwal
Breakfast club oktober 2013
Breakfast club oktober 2013
AmalieFrom
Destaque
(14)
Access lesson 04 Creating and Modifying Forms
Access lesson 04 Creating and Modifying Forms
Business in russia
Business in russia
1 borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
Access lesson 03 Creating Queries
Access lesson 03 Creating Queries
TFG BUFF
TFG BUFF
85
85
TFG DIPUTACIÓ DE BARCELONA
TFG DIPUTACIÓ DE BARCELONA
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
Access lesson 02 Creating a Database
Access lesson 02 Creating a Database
Controle automatico de_processos
Controle automatico de_processos
Access lesson 01 Microsoft Access Basics
Access lesson 01 Microsoft Access Basics
Easiest way to start with Shell scripting
Easiest way to start with Shell scripting
Breakfast club oktober 2013
Breakfast club oktober 2013
3 matrix in c++ programming aramse
1.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 1 Programming C++ ©by ARAM-CSD .کۆلۆم ڵێنده پێی ستوونی دووری ڕۆو ڵێنده پێی ئاسۆیی دووری که پێکهاتووه دووری دوو له :ماترێکس بنهله دورری دوو بوونی دروست گشتی مایڕیزکراوهبه کانداشێوه میهیه: جۆر ناو قهباره2قهباره1 Type array [size1][size2]; A[ i ][ j ] سهرهپێویسته تاوههه کوبه موورنامههێده ( پێشوو کانیکه بنووسین بۆ ر)یبهسه شێکیرهبه کیرنامهکهیه. وهئهگهبه پێویستمان رههده بوو تر کردارێکی جۆر رله بێهێدهبکه زیادی رداوه ینک(که بیرکاری حساباتی توانی)تێدهکهیان ،وێتحه و تێکست (نووسینله )رفبهرنامهکه.دا 1.#include <iostream.h> 2.#include <conio.h> 3.#include <math.h> 4.#include <cstring.h> یه خاڵیکهدووه و مسه مرههێده بۆ کینرهکهکهدهله بێتههبه موورنامهیهبه بنووسرێت کدا:اڵم خاڵێ3بهکه بیرکاری (حساباتی بۆ کاردێتتوان،ڕهگ،ته.)... ژێ خاڵی4بهحه و تێکست ( بۆ کاردێتله )رفبهرنامهکه.دا ده پاشانچینهبهشی(دیکلهره)یشنکهئهبه مشهبهکه دێت لێدوان مانایئه تیایداوشتانهکه یپێویستمانهدهیان به ناسێنینبهرنامهکهئهجۆره چوار میش: 1. int ئینتیجهبه رژماره بۆ کاردێتته یواوهکان 2. float به فلۆتڕێژه ژماره بۆ دێت کاریهکان 3. string به سترینگوشه نوسینی بۆ کاردێتناو یان 4. char کارهکتهبه رته نوسینی بۆ کاردێتیه نهاحه کرف لهبه پێویستمان دا ماترێکسنهگۆڕێکهکهدهله بێتسهرهبکه داغڵی تاداله ین(هێده دوایر)هوهبهم شێوه:یه Int const size1=?,size2=?; ئاسۆی Row ستوونی Column
2.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 2 Programming C++ ©by ARAM-CSD ئهگهژماره ریه ستوونی و ئاسۆی یوه بوو کسانک3x3،2x2ئهته وانها1قهبارهپێویسته مانبهئه اڵمگهر ئه بوو جیاوازده وادوو بێت2x3،3x4ئهده واقه دوو بێتباره.بنووسین جیاواز ی لێرهده داچینهسهبه رئه تر شێکیماترێکسه ناساندنی ویشکهیهبهشێوه میه Int array[size1][size2]; هه پاشانبه شتێکمان روه بیناسێنین پێوستا کارهێنا( کi,j,n,k,l,m,)int i,j; پاشانmain() {دهده نووسینده ستکهبه ینبهرنامهداڕشتنهکه. تهئه نهانه وشتاکه بێتلهسهرهوهناساندوومانهوهقه کبارهوه ناو ودووباره نابێت.ناسێنین بیان لههه بۆ دا ماترێکسبه پێویستمان کردارێک مووده لووپ دووکه بێتبهد )(فۆڕه.کرێت وه( کcin, cout,if,وه )ههکه تر کردارێکی ر.بوو پێویست for(i=0;i<size1;i++) { for(j=0;j<size2;j++) { _____ _____ }} لێرهیه لووپیکهکه مبه(i( و )size1به )ستراوهبهڕیزه بۆ کاردێتئاسۆیهکه کانلهده سفرپێده ستتا کات دانهیهکه کمترله(size1.) وهدووه لووپیکه مبه(j( و )size2به )ستراوهبهڕیزه بۆ کاردێتستوونیهکه کانلهده سفرپێده ستتا کات دانهیهکه کله متر(size2.) ( کردن داغڵ /أcin>>:)ماترێکسی :نموونه بۆA2x2کهقهبارهکامانn=2قهبارهیه یانکسانه for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} لێرهله دابهئه روهقه یبارهکه= مان2واته2x2دهبێت4ژمارهبکه داغڵبه ینشێوه میهخواره یوه: Cin>>a[i][j]; 1 2 3 4
3.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 3 Programming C++ ©by ARAM-CSD لێرهکه کاتێک داژمارهده داخڵکهده ینکه بزانین بێیهکهژماره مدهچێتهa[i=0]وهدووهژماره مدهچێتهa[j=0] واتهa[i=0][j=0]یهکهژماره مدووه وژماره مدهکه گرنبهشێوهناوه دامان لوپ دوو یواتهههموو کردارهپه کانمانیوهبه ندیiوjههیهکهماتریک بۆ گرنگن زۆرسلهبه.کارهێنانیاندا به // تێبینیشێوه هیچیهکcin>>واتهئینپوت<<endlو<<” “وهراسته رناگرێتبه وخۆشێوه میه cin>>a[i][j]<<endl<<” “; cin>>a[i][j]; }} cout<<endl<<” “; /بدهستکه( وتcout<<:ئه )به مشهئهئه نجامیکردارهده مانکه داتێکردووه داغڵمانلهسهشاشه رکه. بهشێوه میه: for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<” “; } cout<<endl; } نموونه بۆئهوهکه یلهسهرهوهداغڵمانکردووهبهشێوه میهدهرده:چێت 1 2 3 4 کهڕهنگهسوورهدهبه بێتیه ڕیزیکهواته ممانایiدهگهیهوه نێتڕهنگهشینهکهدهبه بێتدووه ڕیزیواته م jدهگهیه.نێت وهلههه دوائه موویمانهئه بۆوهشاشه یڕهشهکهده بۆ مانربکهالنه و وێتدایده خۆمان تا چێتخهینده:نووسین getch(); }
4.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 4 Programming C++ ©by ARAM-CSD ئێستهئهگههه رئه مووکردارانه وسه یرهوهبکهبه ینقه ماترێکسێکیباره3بهشێوه میهدهرده:چێت //write C++ program to read and print the matrix A3x3 . 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 for(i=0;i<n;i++) { for(j=0;j<n;j++) { INPUT cin>>a[i][j]; }} cout<<endl; int const n=3; int a[n][n]; Declaration int I,j; #include <iostream.h> #include <conio.h> for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout <<a[i][j]<<” “; OUTPUT } cout<<endl; } getch(); } Header END
5.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 5 Programming C++ ©by ARAM-CSD لێرهکۆمه دانموونه ڵێکداناوه شیکارکراوم یئه بۆوهبگه تێ لێێ زیاتر ین 1- Write C++ program to read and print out the Matrix A3x3 .then print sum of all rows. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int sum[n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<endl; } cout<<endl; for(i=0;i<n;i++) { sum[i]=0; for(j=0;j<n;j++) { sum[i]=sum[i]+a[i][j]; } cout<<"Sum of row ("<<(i+1)<<")="<<sum[i]<<endl; } getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Sum of row (1) = 6 Sum of row (2) = 15 Sum of row (3) = 24
6.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 6 Programming C++ ©by ARAM-CSD 2-Write C++ program to read and print out the Matrix A3x3 .then print sum of all columns. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int sum[n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<endl; } cout<<endl; for(j=0;j<n;j++) { sum[j]=0; for(i=0;i<n;i++) { sum[j]=sum[j]+a[i][j]; } cout<<"Sum of column ("<<(j+1)<<")="<<sum[j]<<endl; } getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Sum of column (1) = 12 Sum of column (2) = 15 Sum of column (3) = 18
7.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 7 Programming C++ ©by ARAM-CSD #include <iostream.h> #include <conio.h> int const n=3,m=2; int a[n][m]; int i,j,sum[n],mult[m]; main() { for(i=0;i<n;i++) { for(j=0;j<m;j++) { cin>>a[i][j]; }} cout<<endl; cout<<"A1"<<"t"<<"A2"<<endl; cout<<"___________"<<endl; for(i=0;i<n;i++) { for(j=0;j<m;j++) { cout<<a[i][j]<<"t"; } cout<<endl; } cout<<"____________"<<endl; for(i=0;i<n;i++) { sum[i]=0; for(j=0;j<m;j++) { sum[i]=sum[i]+a[i][j]; } cout<<"Sum of row ["<<(i+1)<<"]="<<sum[i]<<endl; } cout<<"_________________n"<<endl; for(j=0;j<m;j++) { mult[j]=1; for(i=0;i<n;i++) { mult[j]=mult[j]*a[i][j]; } cout<<"Mult of col ["<<(j+1)<<"]="<<mult[j]<<endl; } getch(); } 3-write a program to read and printout Matrix Anxm, then find the sum of each row in A and Multiplication of each column in A.
8.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 8 Programming C++ ©by ARAM-CSD 4- Write program to create an array A2x2. first row are EVEN and second row are ODD. #include <iostream.h> #include <conio.h> int const n=2; int a[n][n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; cout<<"__"<<"t"<<"__"<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<"t"; } cout<<endl; } cout<<"n__________________n"; cout<<"__"<<"t"<<"__"<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i][j]%2==0) cout<<a[i][j]<<"t"; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(a[i][j]%2==1) cout<<a[i][j]<<"t"; }} getch(); } 1 2 3 4 __ __ 1 2 3 4 ___________ __ __ 2 4 1 3
9.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 9 Programming C++ ©by ARAM-CSD 5-Write C++ program to read and print out the Matrix A3x3 when Diagonal equal to Zero. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(i==j) a[i][j]=0; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<"nn"; } getch(); } 1 2 3 4 5 6 7 8 9 0 2 3 4 0 6 7 8 0
10.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 10 Programming C++ ©by ARAM-CSD 6-Write C++ program to read and print out the Matrix A3x3 .then print sum of lower triangular. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j,l; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<"nn"; } l=0; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(i<j) l=l+a[i][j]; } } cout<<"Sum of Lower Triangular="<<l; getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Sum of Lower Triangular=11
11.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 11 Programming C++ ©by ARAM-CSD 7- Write C++ program to read and print out the Matrix A3x3 .then print sum of Upper triangular. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j,u; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<"nn"; } u=0; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(i>j) u=u+a[i][j]; } } cout<<"Sum of Upper Triangular="<<l; getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Sum of Upper Triangular=19
12.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 12 Programming C++ ©by ARAM-CSD 8- Write C++ program read and print the matrix A3x3, and find the Identity of the matrix. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j,k; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; }cout<<endl;} cout<<"nThe Identity of the Matrixn"<<"_____________________n"; k=0; for(i=0;i<n;i++) { for(j=0;j<n;j++) {if(i==j) a[i][j]=1; else a[i][j]=0; } } for(i=0;i<n;i++) { for(j=0;j<n;j++) {cout<<a[i][j]<<" "; }cout<<"n"; } getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 The identity of the Matrix ______________________ 1 0 0 0 1 0 0 0 1
13.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 13 Programming C++ ©by ARAM-CSD 9- Write C++ program read and print the matrix A3x3, and find the Trace of the matrix. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j,k; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; } cout<<endl; } cout<<endl; k=0; for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(i==j) { k=k+a[i][j]; } }} cout<<"nThe Trace of the Matrix="<<k; getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 The Trace of the Matrix=15
14.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 14 Programming C++ ©by ARAM-CSD 10- Write C++ program read and print the matrix A3x3, and make the lower triangular=0. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; }cout<<endl;} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) {if(i<j) a[i][j]=0; cout<<a[i][j]<<” “; } cout<<endl; } getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 0 0 4 5 0 7 8 9
15.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 15 Programming C++ ©by ARAM-CSD 11- Write C++ program read and print the matrix A3x3, then check whether is symmetric or not. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j,k; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; }cout<<endl;} cout<<endl; k=0; for(i=0;i<n;i++) { for(j=0;j<n;j++) {if(a[i][j]==a[i][j]) k=k+1; }} if(k==n*n) cout<<”The Matrix is symmetric”; else cout<<”The Matrix is not symmetric”; getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 The Matrix is not symmetric 1 2 3 2 5 6 3 6 9 1 2 3 2 5 6 3 6 9 The Matrix is symmetric
16.
May 13, 2012
TWO-DIMENSIONAL ARRAYS (MATRIX) 16 Programming C++ ©by ARAM-CSD 12- Write C++ program read and print the matrix A3x3, and make the Upper triangular=0. #include <iostream.h> #include <conio.h> int const n=3; int a[n][n]; int i,j; main() { for(i=0;i<n;i++) { for(j=0;j<n;j++) { cin>>a[i][j]; }} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) { cout<<a[i][j]<<" "; }cout<<endl;} cout<<endl; for(i=0;i<n;i++) { for(j=0;j<n;j++) {if(i>j) a[i][j]=0; cout<<a[i][j]<<” “; } cout<<endl; } getch(); } 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 0 5 6 0 0 9
Baixar agora