I am trying to create a program that raises 10 to the power of the index number (1 for index 0, 10 for index 1, 100 for index 2, etc.). When I run this program, it does not output anything. What is the issue?
#include<iostream>
#include<cmath>
using namespace std;
int* powersOfTwo(int n);
int* powersOfTwo(int n)
{
int i, x=10;
n=3;
int *arr = new int(n);
for (i=0; i<=n; i++) {
arr[i]=pow(x, i);
cout<<arr[i]<<endl;
}
return 0;
}
int main() {
powersOfTwo;
return 0;
}