//**********************//program to execute multiple statements
#include <iostream.h>
void main ()
{
cout << "Hello World!";cout<<" I am a c++ programmer";
getch();
}We can use the "cout" expression to declare a line statement in c++. cout is declared in the iostream standard file, so that's why we needed to include that specific file and to declare that we were going to use this specific namespace earlier in our code.
Notice that the statement ends with a semicolon character (
;). This character is used to mark the end of the statement and in fact it must be included at the end of all expression statements in all C++ programs (one of the most common syntax errors is indeed to forget to include some semicolon after a statement)." // " is used to give a comment in C++.
No comments:
Post a Comment