i have this C++ problem to write a C++ program that asks for 5 integers for each of the 5 rows. the program displays the values by row along with the sum per row and per column..
and the output should look like this:
Row1
Enter an integer: **
Enter an integer: **
Enter an integer: **
Enter an integer: **
Enter an integer: **
Row2
Enter an integer: **
Enter an integer: **
Enter an integer: **
Enter an integer: **
Enter an integer: **
and so on until 5 rows, then displays the sum but first shows the msg.
"You have entered the following:"
and then shows the user input with the sum in row and then the sum in column..
like that.. the point is uMMMmm.. please i need some modification... my deadline is friday if anyone could and would please.. modify this program below to make it be like above it will be highly appreciated! ^_^
here is my program to be modified using (i'm using Dev-C++) DEV-C++ by the way:
#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
int main ()
{
const int row = 5;
const int col = 5;
int number[row][col];
int r,c,sum1=0;
for (r=0;r<row;r++)
{
cout<< "Row " << r+1 <<endl;
for(c=0;c<col;c++)
{
cout<<"Enter an integer: ";
cin>>number[r][c];
}
}
cout<<"You entered the following: "<<endl;
for (r=0;r<row;r++)
{
if(r<1)
cout<<"\t\t\t\t\t Sum\n";
sum1=0;
for(c=0;c<col;c++)
{
cout<<" "<<number[r][c]<<" \t";
sum1+=number[r][c];