Friday, January 20, 2012

How C++ works: basics, First program

Tools of the trade
• Editor
• Interpreter and Compilers
• Debuggers
Integrated Development Environment
(IDE)




#include <iostream.h>

main ( )

{

cout << “ hellow world “;

}

cout<< can be used with

Variable 
 –cout<<num;
•String
–cout<<“Hello Word”;
•Expression
–cout<<a + b;
•Constant
–cout<<20;
•Call of Function
–cout<<pow(a);
Escape Sequence


\a Bell (beep)

\b Backspace

\n New Line

\r Return

\t Tab (8 spaces)



#include <iostream.h>

main ( )

{

cout << “\n\t Hello world \n“;

cout<<“ \n This is your first program\n”; }

No comments: