My First Succesful C++ Program

Posted by MahFreenAmeh on Feb. 15, 2006, 11:35 a.m.

NOTE: [ = <, ]= >

#include [iostream.h]

#include [stdlib.h]

#include [iostream]

int main()

{

/* Variables. */

int a,b,c,d;

int result;

/* Math */

bool keypressed;

a=25;

b=10;

c=15;

d=a+b+c;

result=a+b+c+d+d;

if(result >=20)

{

cout << "The result is Greater than or equal to 20.

";

}

else if(result <=20)

{

cout << "Somehow, the output is less than, or equal to 20.

";

}

cout << "So, The Result is " << result << "

";

cout << "Please press any key, then Enter, to continue!

";

cin >> (char)keypressed;

if(keypressed)

{

return 0;

}

}

I had to create this second one because in the original blog, i accidentally put a comment line in, and forgot to close it.. So now, every time i try and delete it, because i close the comment in an earlier post on the same page, it deletes that post. The one below this may say the same title, but it's my "Madness Is Resting" picture thing.

Comments

Kaz 18 years, 10 months ago

You do realize theres a delete button once you edit the blog?

BTW good work.

MahFreenAmeh 18 years, 10 months ago

I couldn't edit the other Blog.. I put an unclosed comment in it, so it got rid of the delete button from the original.

ludamad 18 years, 10 months ago

It's deleted now, weeeeeeeee