Skip to content

Instantly share code, notes, and snippets.

@khatabwedaa
Last active March 17, 2019 07:56
Show Gist options
  • Save khatabwedaa/a0253055acec018636c980c89021ca31 to your computer and use it in GitHub Desktop.
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
#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;
}
@khatabwedaa
Copy link
Author

how cani help you @ektfa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment