Sum of square of all the elements in a 2d numpy array
Answers
Answered by
0
ssq = np.sum(res**2)
HOPE IT HELPS U !!
Answered by
0
Answer:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int r, c,s=0;
cout<<"\nEnter number of rows";
cin>>r;
cout<<"\nEnter number of columns";
cin>>c;
//loop for input
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
cout<<"\nEnter any number";
cin>>a[i][j];
}
}
//loop for process
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
s=s+(a[i][j]*a[i][j]);
}
}
cout<<s;
getch();
}
Similar questions
Hindi,
6 months ago
Math,
6 months ago
English,
11 months ago
Psychology,
11 months ago
Chemistry,
1 year ago