C++ First Program
C++ First Program
Sample C++ Program
/*
This is a simple C++ program.
Call this file Sample.cpp.
*/
#include <iostream>
using namespace std;
// A C++ program begins at main().
int main()
{
cout << "C++ is power programming.";
return 0;
}
Output :
C++ is power programming.
Explanation: First C++ Program :
Consider the following line in the programs –
/*
This is a simple C++ program.
Call this file Sample.cpp.
*/
2. Comments are written for user understanding.
#include <iostream>
C++ program.
int main()
7. The return type of the C++ main function is an integer, whenever the main function returns 0 value
to operating the system then program termination can be considered as smooth or
proper.
to operating the system then program termination can be considered as smooth or
proper.
will return the non- zero value to the operating system.
cout << "C++ is power programming.";
return 0;
10. Return statement sends the status report to the operating system about program
execution whether program execution is proper or illegal.
0 comments:
Post a Comment