FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


My source codes (sample c++ programs)





codermage
Lesson 1- introduction: Housing

Code:
#include <iostream> // a directive
using namespace std; // a namespace directive (use std namespace)
int main() // main function
{
/* Program Contents Area*/
return 0;
}
codermage
Lesson 2- Display Output: cout, endl, <<

Code:
#include <iostream> // use for cout, endl
#include <cstdlib> // use for system() functions..
using namespace std; // using std for cout, endl
int main()
{
   cout << "CODErMAGE & FRIHOST FORUM" << endl; //cout: output, endl: line through, <<: a separator
   cout << "let's meet again" << endl;
   system("PAUSE"); // we've stopped program, until a key is pressed
   return 0;
}
codermage
Lesson 3-Input and Variables: cin, char, string, int, short, long, float, double, bool

Code:
#include <iostream> // use for cout, endl
#include <cstdlib> // use for system() functions..
#include <string> // use for string veriable types
using namespace std; // using std for cout, endl
int main()
{
   int x; //
   int age;
   string name;
   cout << "Hi! I'm CODErMAGE, Please enter your name" << endl;
   cin >> name;
   cout << "Please enter your date of birth: " << endl;
   cin >> x;
   age = 2010 - x;
   cout << "Dear " << name << " You're " << age << " years old.." << endl;
   system("PAUSE");
   return 0;
}
codermage
im sorry Sad for posted here this topic. Please can u mods move to tutorials?
SlashnburnSoftwareStudio
Hope Lesson 4 is worth the wait Wink
Related topics
New Site for Source codes
C++ assignment help
Creating a new Operating System
An open-source cross-platform C++ IDE
C++ fresh_dude --> mutationx
SharpDevelop: Open Source Visual Studio .NET
Dynamic PHP Images
Compression Algorithms
PHP what is it actually?
IN NEED:VB 2005 Express Sample Projects
Learn to program in 20 something days!
Open-source IDE
Notepad upgrade
Introduction to 'Null'
Reply to topic    Frihost Forum Index -> Miscellaneous -> Tutorials

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.