# include
using namespace std;
int main()
{
cout<<"Welcome to C++";
return 0;
}
- Use IDE such as CodeBlocks to run this program. To do this, open CodeBlocks, Goto File->New->Empty File.
- Copy the above code and go to File->Save the file. Give a name and extension .cpp.
- About the program: Program execution ALWAYS starts from the main; this is a function. We will discuss more functions in later discussions; for now, consider it as a machine. You give some input; you get some output. Cout << is used to print any output messages or display any information. Remember to enclose messages in double-quotes.
- Dont forget to end lines with semicolons.
- Return 0 returns an integer value 0 for function main.In easy terms, it tells that everything worked fine.
- Functions always have opening and closing brackets.
- # include is a preprocessor directive telling the compiler to add header file iostream before including the rest of the program.IOSTREAM is an Input-Output stream. It allows you to use various objects related to I/O.
- Using name std. C++ has a standard library that contains common functionality you use in building your applications. The using namespace means that in the scope it is present, make all the things under the std namespace available without having to prefix std:: before each of them.