Trying to get the square of the numbers 1-100, but not use the square() function. I want to instead use repeated addition in a self made function that will do the same thing as square(); I'm getting nothing but zeros as my output though and was wondering what I'm doing wrong. Any help would be appreciated.
#include<iostream>
using namespace std;
int taco(int x)
{
int t=0;
for(int p=0; p>x; ++p)
{
t=t+x;
}
return t;
}
int main()
{
for(int i=0; i<100;++i)
{
cout<<taco(i)<<endl;
}