Solution to Given an array A (8,8). Find the sum and the number of positive elements, located … - Sikademy
Author Image

Archangel Macsika

Given an array A (8,8). Find the sum and the number of positive elements, located below the main diagonal the smallest element of the array (minimum).

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> using namespace std; int main() { int A[8][8]; int sumNumberPositiveElements=0; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ cout<<"Enter number ["<<i<<"]"<<"["<<j<<"]: "; cin>>A[i][j]; } } int smallestElementArray=A[0][0]; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ if(i>j){ sumNumberPositiveElements+=A[i][j]; } if(smallestElementArray>A[i][j]){ smallestElementArray=A[i][j]; } } } cout<<"\nSum of elements below the diagonal: "<<sumNumberPositiveElements<<"\n"; cout<<"The smallest element of the array: "<<smallestElementArray<<"\n"; system("pause"); return 0; }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1108-qpid-104