What is Programming?
Simply writing codes; however, the codes should have a correct format:- Readability - Writeability
- Documentation: Header comments for each module,
- meaningful inline comments for code
- Correctness
A C++ Sample code with a fine format:
#include <iostream> // Including Input Output library
using namespace std; // using namespace" is a command, and "std" is a little something called a library. "std" stands for "standard".
int main() // Main function
{
cout << "Hello world!" << endl; // Will be print Hello World on screen.
return 0;// Main function always return 0.
}
using namespace std; // using namespace" is a command, and "std" is a little something called a library. "std" stands for "standard".
int main() // Main function
{
cout << "Hello world!" << endl; // Will be print Hello World on screen.
return 0;// Main function always return 0.
}
No comments:
Post a Comment