need to write array with 50 elements, use each content of array and
output of them square and squareroot and need to print.
this code is for square but my code have problems do not give me output, can you please help?
output of them square and squareroot and need to print.
this code is for square but my code have problems do not give me output, can you please help?
#include <iostream>
#include <math.h>
using namespace std;
int square(int,int);
main()
{
int size=50; //Array size
int array[size]; //Declaring array
int sum=0;
for(int i=0;i<size;i++) //Loop which inputs arrays data and
//Calculates its sum
{
sum={[i]*[i]}
cout<<sum<<endl;
}
}
int square (int sum,int size)
{
return sum;
}