Answer to Question #4721 in C++ for Nij

Question #4721
I really don't get the basics of writing a program like #include <iostream.h> like should we use space or not i just want ma basics to be strong so that i don't suffer in ma boards that is grade 12th.
1
Expert's answer
2011-10-21T08:50:36-0400
#include "iostream" // header file //<-- this is a single comments

/*& <-- multiply comments
iostream is a header file which is used for input/output in the C++ programming language.
It is part of the C++ standard library. The name stands for Input/Output Stream.
In C++ and its predecessor.
iostream uses the objects cin, cout, cerr, and clog for sending data to and from the standard streams input,
output, error (unbuffered), and error (buffered) respectively. As part of the C++ standard library, these objects are a
part of the std namespace.
*/
using namespace std; // declaration namespace, this is standart namespace

int main()
{
int a;& // initialize new variable
cout<<"Input your age "; // output
cin>>a; //input
cout<<"Your age is "<<a<<endl; //output. endl takes on a new line
system("pause"); // this directive show you a programme result after finish
return 0;& // main function return 0 if all ok, and 1 if something mistakes
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS