#include<iostream>
using namescacestd;
int main()
{
int size;
float sum=0;
cout<<"pls enter count your array"<<endl;
cin>>size;
float **arr = new float *[size];
for (int v = 0; v < size; v++)
arr[v] = new float[size];
cout<<"pls enter your array"<<endl;
for(int i=0;i<size;i++)
for(int j=0;j<size;j++)
cout<<"arr["<<i<<"]["<<j<<"] = ";
cin>>arr[i][j];
cout<<endl;
sum=sum+arr[i][j];
}
cout<<"Sum array = "<<sum<<endl;
free(array);
system("pause");
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include<iostream>
using namescacestd;
int main()
{
int size;
float sum=0;
cout<<"pls enter count your array"<<endl;
cin>>size;
float **arr = new float *[size];
for (int v = 0; v < size; v++)
arr[v] = new float[size];
cout<<"pls enter your array"<<endl;
for(int i=0;i<size;i++)
for(int j=0;j<size;j++)
{
cout<<"arr["<<i<<"]["<<j<<"] = ";
cin>>arr[i][j];
cout<<endl;
sum=sum+arr[i][j];
}
cout<<"Sum array = "<<sum<<endl;
free(array);
system("pause");
return 0;
}