Jump to content

Check out the C++ program I created.


Oleg

Recommended Posts

#include <iostream>

#include <cstdlib>

using namespace std;

int main()

{

if (10 == 20)

cout << "10 equals to 20" << endl;

else

cout << "10 equals to 10" << endl;

cin.get();

}

How do you like the program? Do I show a certain potential as a programmer?

Oops, I don't know why I included <cstdlib> in the program. I guess I wanted to have exit(0) statement in the program.

Link to comment
Share on other sites

Yeah, I am only a beginner in C++, but it's cool!

I created another meaningless program:

#include <iostream>

using namespace std;

int num1(int num)

{

return num * num / 3;

}

int main()

{

int num = 5;

cout << num1(num) << endl;

}

I created the executable file by running this beautiful command: g++ compile1.cc -ansi -pedantic-errors

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...