You are on page 1of 1

Coding C++

#include<iostream> header files


using namespace std; 1. Variables
2. Data Types
int main () return type of the main function 3. Printing Out Variables
{ opening bracket of the main function 4. Variable Data Types
cout<<“Hello World!” <<endl; 5. Input Values to Variables
return 0; 6. Make a one function
} closing bracket of the main function Calculator

cout is the console output


“Hello World!” is the output to display on Data Types
screen
String - a series of characters
return 0; is the main function returns null
Character or char - represent single
value
character (letter, symbol, digit)
Integer or int - represent whole number
String Boolean or Bool - represent the value
true or false
#include<iostream> Double - represent more precise
using namespace std; values.
Floats - represent numbers with
int main ()
fractional parts.
{
string fire = “radleigh”;
cout << fire << “is my Riego” <<endl;
return 0;
Variables
} Considered as a container in
programming to store data values.

Calculator endl or endline - used to break lines to


#include<iostream> turn into new lines.
using namespace std; cout - statement used to display
characters in C++.
int main () << or less than - operator used in cout.
{ ; or semicolon - often used at the end
Int x,y; of the command.
cout << “Enter first number”<<endl; cin - statement that accepts input. also
cin >>x; known as character input.
cout << “Enter second number”<<endl; #include <iostream> - considered as a
cin >> y; channel in C++ always placed at the
header file.

You might also like