Computer Science, asked by Rocknain9158, 11 months ago

Sum of square of all the elements in a 2d numpy array

Answers

Answered by Saumya004
0

\huge\blue{Answer}

ssq = np.sum(res**2)

HOPE IT HELPS U !!

Answered by Soñador
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