you know C++!

Shive& Singh
3 min readOct 3, 2022

--

C++ (plus-plus) are the features added to the C language by Bjarne Stroustrup at AT & T Bell labs. It allows all C language syntax and brings some new too.

a high-level language that can communicate with computers while maintaining the complexity for users. The most preferred language of the competitive coding world as it offers fast compiling time and less complex syntax style.

Writing the first program:

#include <iostream>
using namespace std;
int main()
{
cout << “HELLO WORLD!” << endl;
return 0;
}

line(i) : the header file to recieve input and display output
line(ii) : adding the namespace variables to scope from standard
line(iii) : is the main function of the program adding int means function will return an integer
line(iv) : opens the main function to start from
line(v) : cout(console out), display what inside double qotes(“”),endl depicts new line and a semicolon to end the whole statement
line(vi) : return the int asked in line(iii) some recent update version does not demands to write this statement
line(vii) : end of the function main

OUTPUT : HELLO WORLD!

GETTING USER INPUT

asking user to enter the input value and to use it we need to store somewhere right,

hence we declare variable

int var; (here “int” depict the data type we want form user and “var” is name of variable in which we will save out input int value)

now asking user to ready to enter

cin >> var; (here “cin” is console input and var is a variable we decalare earlier to store the entered value , it allows to take multiple input in single declaration we just need to separate the variable name through comma (,))

Writing next program:

#include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
int c = a+b;
cout << c << endl;
return 0;
}

line(v) : two variables ‘a’ and ‘b’ are ready to store the value of integer type
line(vi) : ask user to enter the both value to console
line(vii) : again a variable ‘c’ is ready to store the value of integer type after adding the two entered values
line(viii) : display out the stored value in variable ‘c’
OUTPUT : 2 2
: 4

now the input value can be of any type like FLOAT (decimal value),STRING (group of characters),CHARACTER(single character value)
NOTE :- the value to be entered must always be of same data type as declared.

RESOURCES :

SHOW YOUR SKILLS :

now you are are ready to start your journey with the battle experience and show case your C++ skills try practise by writing more of your thoughts in C++

and now,

you know C++ .

--

--