السلام عليكم....
ارحموا من في الأرض يرحمكم من في السماء...
اخواني ابيكم اتساعدوني فحل هالمسالتين اللي والله اني مب فاهمنتهم و ياتنا اليوم في الإمتحان و ارجوكم ساعدوني....!!!
problem1 initialize a two dimensional float array x of 20 rows (i) and 20 coloums(j) so that each element at row (i) and coloum (j) =(i-j) /(i+j) . write a c++ function maxmin() that finds the largest and smallest value in the array and display the result on screen using a seperate function display and
و هذا حلي اللي شاكة انه مليون في المية غلط....
#include <iostream>
using namespace std;
void display(float [][4],int);
void SumRowCol(float [][4],int);
int main ()
{
float x[4][4];
for (int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{
cout<<"Element at position [" <<i<< ", " <<j<<" ] is:";
cin>> x[j];
}
display(x,4);
sumRowCol(x,4);
}
return 0;
}
void display(float x[][4],int size)
{
for (int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{cout<<"\n\nElement at position [" <<i<< ", " <<j<<" ] is:" <<x[j]<<endl;}
}
}
void SumRowCol(float x[][4],int size)
{
int sum-row ,sum_col=0;
for(int i=0; i<4;i++)
{
sum_row=0;
sum_col=0;
for(int j=0; j<4; j++)
{
sum_row =sum_row+x[j];
sum_col =sum_col+x[j];
}
cout<<"n\nSum of Row "<<i<<" is "<<sum_row<<endl;
cout<<"n\nSum of Colum "<<i<<" is "<<sum_col<<endl;
}