SlideShare a Scribd company logo
1 of 2
Download to read offline
UNIVERSIDAD FERMÍN TORO
VICE RECTORADO ACADÉMICO
FACULTAD DE INGENIERÍA ELÉCTRICA
Introducción a la
computación:
Arreglos bidimensionales
Participante: Carla Montilla
Prof.: Esteban Torrealba
Agosto 2017
#include <iostream>
#include <vector>
using namespace std;
int main() {
int mayor = 0, menor = 0;
unsigned int posMayorI, posMayorJ;
unsigned int posMenorI, posMenorJ;
unsigned int i, j, filas, columnas;
cout << "Filas: ";
cin >> filas;
cout << "Columnas: ";
cin >> columnas;
int matriz[filas][columnas];
for (i = 0; i < filas; ++i) {
for (j = 0; j < columnas; ++j) {
cout << "Elemento[" << i << ", " << j << "]: ";
cin >> matriz[i][j];
}
}
mayor = matriz[0][0];
menor = mayor;
for (i = 0; i < filas; ++i) {
for (j = 0; j < columnas; ++j) {
const int valor = matriz[i][j];
if (valor > mayor) {
mayor = valor;
posMayorI = i;
posMayorJ = j;
}
if (valor < menor) {
menor = valor;
posMenorI = i;
posMenorJ = j;
}
}
}
cout << "Mayor valor: " << mayor << endl;
cout << "Posicion de mayor: (" << posMayorI;
cout << ", " << posMayorJ << ")n";
cout << "Menor valor: " << menor << endl;
cout << "Posicion de menor: (" << posMenorI;
cout << ", " << posMenorJ << ")n";
return 0;

More Related Content

What's hot

Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
ismailaboshatra
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
Piyush Rochwani
 

What's hot (13)

Black & White tiles problem
Black & White tiles problemBlack & White tiles problem
Black & White tiles problem
 
Write a program to perform translation.
 Write a program to perform translation. Write a program to perform translation.
Write a program to perform translation.
 
Unsigned and Signed fixed point Addition and subtraction
Unsigned and Signed  fixed point Addition and subtractionUnsigned and Signed  fixed point Addition and subtraction
Unsigned and Signed fixed point Addition and subtraction
 
Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
 
Formulas
FormulasFormulas
Formulas
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 
C programming codes for the class assignment
C programming codes for the class assignmentC programming codes for the class assignment
C programming codes for the class assignment
 
Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標Processing資料(5) 正弦波と極座標
Processing資料(5) 正弦波と極座標
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word document
 
2 d rotation
2 d rotation2 d rotation
2 d rotation
 
Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]
 
Processing資料(8) 文字
Processing資料(8) 文字Processing資料(8) 文字
Processing資料(8) 文字
 
PROGRAM FOR INSERTION SORTING IN ARRAY
PROGRAM FOR INSERTION SORTING IN ARRAY PROGRAM FOR INSERTION SORTING IN ARRAY
PROGRAM FOR INSERTION SORTING IN ARRAY
 

Similar to Arreglos bidimencionales carla montilla

OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++
Allan Sun
 
Programa.eje
Programa.ejePrograma.eje
Programa.eje
guapi387
 
Hello My code prints but I need this exact code to print unt and hav.pdf
Hello My code prints but I need this exact code to print unt and hav.pdfHello My code prints but I need this exact code to print unt and hav.pdf
Hello My code prints but I need this exact code to print unt and hav.pdf
almonardfans
 

Similar to Arreglos bidimencionales carla montilla (20)

Arreglo bidimensional
Arreglo bidimensionalArreglo bidimensional
Arreglo bidimensional
 
ماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارامماترێکس به‌ کوردی ئارام
ماترێکس به‌ کوردی ئارام
 
OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++OOP 2012 - Hint: Dynamic allocation in c++
OOP 2012 - Hint: Dynamic allocation in c++
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and Polynomial
 
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
 
Introduction to cpp (c++)
Introduction to cpp (c++)Introduction to cpp (c++)
Introduction to cpp (c++)
 
ParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdf
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
 
Programa.eje
Programa.ejePrograma.eje
Programa.eje
 
Hello My code prints but I need this exact code to print unt and hav.pdf
Hello My code prints but I need this exact code to print unt and hav.pdfHello My code prints but I need this exact code to print unt and hav.pdf
Hello My code prints but I need this exact code to print unt and hav.pdf
 
Mithlesh Singh Rawat , BCA Third Year
Mithlesh Singh Rawat , BCA Third YearMithlesh Singh Rawat , BCA Third Year
Mithlesh Singh Rawat , BCA Third Year
 
Array programs
Array programsArray programs
Array programs
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
C++ TUTORIAL 5
C++ TUTORIAL 5C++ TUTORIAL 5
C++ TUTORIAL 5
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Arrays
ArraysArrays
Arrays
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 

Recently uploaded

Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
drjose256
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 
Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
IJECEIAES
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
IJECEIAES
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
Kamal Acharya
 

Recently uploaded (20)

NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...Performance enhancement of machine learning algorithm for breast cancer diagn...
Performance enhancement of machine learning algorithm for breast cancer diagn...
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Low Altitude Air Defense (LAAD) Gunner’s Handbook
Low Altitude Air Defense (LAAD) Gunner’s HandbookLow Altitude Air Defense (LAAD) Gunner’s Handbook
Low Altitude Air Defense (LAAD) Gunner’s Handbook
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Seizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networksSeizure stage detection of epileptic seizure using convolutional neural networks
Seizure stage detection of epileptic seizure using convolutional neural networks
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
Module-III Varried Flow.pptx GVF Definition, Water Surface Profile Dynamic Eq...
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
What is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, FunctionsWhat is Coordinate Measuring Machine? CMM Types, Features, Functions
What is Coordinate Measuring Machine? CMM Types, Features, Functions
 
Online crime reporting system project.pdf
Online crime reporting system project.pdfOnline crime reporting system project.pdf
Online crime reporting system project.pdf
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdfInvolute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
Involute of a circle,Square, pentagon,HexagonInvolute_Engineering Drawing.pdf
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Geometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdfGeometric constructions Engineering Drawing.pdf
Geometric constructions Engineering Drawing.pdf
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 

Arreglos bidimencionales carla montilla

  • 1. UNIVERSIDAD FERMÍN TORO VICE RECTORADO ACADÉMICO FACULTAD DE INGENIERÍA ELÉCTRICA Introducción a la computación: Arreglos bidimensionales Participante: Carla Montilla Prof.: Esteban Torrealba Agosto 2017
  • 2. #include <iostream> #include <vector> using namespace std; int main() { int mayor = 0, menor = 0; unsigned int posMayorI, posMayorJ; unsigned int posMenorI, posMenorJ; unsigned int i, j, filas, columnas; cout << "Filas: "; cin >> filas; cout << "Columnas: "; cin >> columnas; int matriz[filas][columnas]; for (i = 0; i < filas; ++i) { for (j = 0; j < columnas; ++j) { cout << "Elemento[" << i << ", " << j << "]: "; cin >> matriz[i][j]; } } mayor = matriz[0][0]; menor = mayor; for (i = 0; i < filas; ++i) { for (j = 0; j < columnas; ++j) { const int valor = matriz[i][j]; if (valor > mayor) { mayor = valor; posMayorI = i; posMayorJ = j; } if (valor < menor) { menor = valor; posMenorI = i; posMenorJ = j; } } } cout << "Mayor valor: " << mayor << endl; cout << "Posicion de mayor: (" << posMayorI; cout << ", " << posMayorJ << ")n"; cout << "Menor valor: " << menor << endl; cout << "Posicion de menor: (" << posMenorI; cout << ", " << posMenorJ << ")n"; return 0;