Saturday, May 2, 2009

That's right. Something's happening on the blog!

OK, I decided to blow the dust off of this thing, and actually post. It's been a while, and I haven't done much learning over that lapse in time, so here goes something to open your favorite text editor for:

FUNCTIONS

#include
using namespace std;
int add(int x, int y)
{
int f=x+y;
return f;
}
int main()
{
int b=0;
int c=0;
int a=0;
cout<<"Input two numbers to be added.\n";
cin>>b;
cin>>c;
a=add(b,c);
cout<<"The answer is "<< a<<".\n";
}

OK, so either it has absolutely no problems, it got ruined by the server, or you're compiler needs replacing.

2 comments:

squirrel-the-tire said...
This comment has been removed by the author.
squirrel-the-tire said...

ok. this stupid HTML got rid of iostream, but other than that, I got it to keep the << a<< by cleverly spacing it.
basically everything < stuff > is considered an HTML tag. :( I'd like to know how to get rid of that, or figure out the HTML equivalent of
/*
stuff
srhnarxf
*/