Thursday, 8 September 2022

C++ Syntax

                         C++ syntax:



Lets learn the code:
 
#include<iostream>
using namespace std;

int main()
{
     cout<<"Hello world"<<endl;
        return 0;
}

In this above code, 

In Line 1: #include<iostream> it is a library, it can work with input and output files. If we does not write this library then we see a syntax error because with the help of this we can give output and input.

In Line 2: using namespace std, it is used for scope of a function. and we can use names of objects and variables.

In Line 3: int main() , is the starting of a program , everything we write in main() means it will execute. and int is a data type. The Datatypes int, float, double, char, long double all return something. But a datatype void does not return anything.

In Line 4: cout<<"Hello World">>; it means it will execute and print Hello World. Cout means it will display the information.

In Line 5: return 0; it means  return type is int and int is a datatype that will return something so it returns 0.


Note: Every C++ statement ends with a semicolon. and blank spaces will be ignored.

It is a basic syntax for C++ .


Table example:

#include<iostream>
using namespace std;

int main()
{
cout<<"Table of 3"<<endl;
cout<<"-----------"<<endl;
cout<<"3*1="<<3*1<<endl;
cout<<"3*2="<<3*2<<endl;
cout<<"3*3="<<3*3<<endl;
cout<<"3*4="<<3*4<<endl;
cout<<"3*5="<<3*5<<endl;
cout<<"3*6="<<3*6<<endl;
cout<<"3*7="<<3*7<<endl;
cout<<"3*8="<<3*8<<endl;
cout<<"3*9="<<3*9<<endl;
cout<<"3*10="<<3*10<<endl;
}
 

Thursday, 1 September 2022

C++ Introduction 2022

 C++ Introduction:

C++ is a popular programming language, it is used to make computer programs and it is most used language in 2022.It is created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes".
C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for creating large-scale applications. C++ is a superset of the C language. A related programming language, Java, is based on C++ but optimized for the distribution of program objects in a network such as the Internet.




Example:

#include <iostream>
using namespace std;

int main() {
  cout << "Hello World!";
  return 0;
}

Why use C++ in 2022:

It is a standard language within back-end development. It is an efficient language. It's in high demand now, and it will remain in high demand in 2022 because of its reliability, performance, and efficiency.
C++ is now one of the most widely used computer languages, with a wide range of applications. Python, Java, and web programming are all intriguing career paths, but C++ programmers are often overlooked and mistakenly believed to be dead.
C++ is portable and can be used to develop applications that can be adapted to multiple platforms.
C++ is fun and easy to learn!
As C++ is close to C# and Java, it makes it easy for programmers to switch to C++ or vice versa.
Difference between C and C++

C++ was developed as an extension of C, and both languages have almost the same syntax.

The main difference between C and C++ is that C++ support classes and objects, while C does not.





Fiver Account

 Fiver Account: https://www.fiverr.com/s/bPlNbN