Hi there! I'm new to programming and I've trying some exercises of the for loop but I'm having some trouble grasping the whole idea.
Basically I want to evaluate a simple formula y=((5+x)*x) and make the program solve the formula replacing x with every number betweet 1 and 10 (First showing me the numbers between 1 and 10 and then giving me the 10 answers). It shows the numbers between 1 and 10 but doesn't solve the formula, I feel I'm missing something simple.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
int main()
{
double i, y;
for (i=1;i<=10;i++){
cout<<i<<"\t"<<endl;
}
system("pause");
for (i=1;i<=10;i++){
y=((5+i)*i);
}
cout<<y<<endl;
}
It's so bad I was ashamed to post xD but then how else would I learn =)