quote:Original post by Jedyte
Or does your code end up malformed by the forum?
By choosing quote or edit on the original message, you can see it''s because they haven''t used the correct tags for the forum.
quote:Original post by Jedyte
Or does your code end up malformed by the forum?
#include <iostream>using namespace std;int SquareTotal(int toSquare);int main(){ int toSquare; cout<<"this program will square from 1 to the number you have entered.\n"<<endl; cout<<"please enter a number: "; cin>>toSquare; if(toSquare <=0) { cout<<"please enter a non negative, non zero number."<<endl; cout<<"number: "; cin>>toSquare; } cout<<"the number you have entered is: "<<toSquare<<endl; SquareTotal(toSquare); cout<<"the total is: "<<toSquare<<endl; return 0;}int SquareTotal(int toSquare){ int total=0; for (int counter =1;counter<=toSquare;counter++) { total +=counter*counter; } return total;}
quote:please enter a number: 5
the number you have entered is: 5
the total is: 5
quote:Original post by Anonymous Poster
*cough homework cough*
quote:Original post by nobodynews
Your problem was you weren''t using the result.
quote:Original post by drarem
please POST your question as well, don''t just say help with C++.. peeves me having to go in here to see what the subject is..