Last active
March 17, 2019 07:56
-
-
Save khatabwedaa/a0253055acec018636c980c89021ca31 to your computer and use it in GitHub Desktop.
in 2 dimention arrays you can get the small numbers in the Row
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include<stdio.h> | |
using namespace std ; | |
int main() | |
{ | |
int d; | |
int min; | |
//array dimention | |
puts("Enter the array dimention :- "); | |
cin>>d; | |
//min_num for the final minimums numbers | |
int min_num[d]; | |
int arr[d][d]; | |
// array input | |
puts("please enter the array elements :- "); | |
for(int i=0;i<d;i++) | |
{ | |
for(int j=0;j<d;j++) | |
{ | |
cin>>arr[i][j]; | |
} | |
} | |
//array output | |
puts("the array elements you enterd :-"); | |
for(int i=0;i<d;i++) | |
{ | |
for(int j=0;j<d;j++) | |
{ | |
cout<<arr[i][j]<<" "; | |
} | |
cout<<endl; | |
} | |
// the minimum numbers | |
for(int i=0;i < d;i++) | |
{ | |
min = arr[i][0]; | |
for(int j=0;j<d;j++) | |
{ | |
if(min > arr[i][j]) | |
{ | |
min = arr[i][j]; | |
} | |
} | |
min_num[i] = min; | |
} | |
puts("the minimum elements in array :-"); | |
for(int i=0;i<d;i++) | |
{ | |
cout<<min_num[i]<<endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how cani help you @ektfa