A simple Example of a C++ Syntax below
//Sample cpp
// simple addition in c++
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int sum;
cout << "Enter values to sum two numbers?" << endl;
cout <<"enter first value \n"; cin>> a;
cout <<"enter second value \n"; cin>> b;
sum = a+b;
cout <<"The sum of values is " << sum << endl;
return 0;
}
The double back slashes ( “//” are single comment line) used to indicate or remind the creator of what was there before or what needs to be done, the first three lines after the comment lines are mandatory syntax to begin any C++ coding just as you have to include this line of code “<?php echo $something; “?>” when declaring the php syntax, the opening tag ” < ” plus a question mark is needed E.g (< ?) and a question mark and a closing tag " > E.g (?>) is require fo the php syntax to work properly. The Extension for C++ is dot cpp(.cpp), a compiler is needed to execute any c++ codes, so to begin any tutorial on c++, you must first get a compiler. there are some online that are available such as Code-Block Compiler, its Free.