About C++


Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

- Martin Fowler


The C++ programming language was developed by Bjarne Stroustrup and his team at Bell Laboratories (AT&T. USA) to implement simulation projects in an object-oriented and efficient manner. In early 1989, an ANSI committee (American National Standards Institute) was established to standardize the C++ programming language.

The major reason behind the success and popularity of C++ is that it supports the oops concepts. "Object-oriented technology is considered the ultimate paradigm for modeling and information, be it data and logic."

The name C++ (Cplusplus) was coined by Rick Mascitti where "++" is the C increment operator. The latest C++ standard document was issued by ANSI/ISO in year 2017.

What is C++?

C++ is a general-purpose, case-sensitive, free-form programming language which is used to create computer programs.


Object-Oriented Programming (OOPs):-

C++ supports object-oriented programming, there are four types of object-oriented programming used in C ++:

1. Inheritance
2. Polymorphism
3. Encapsulation
4. Abstraction

First C++ Program:-

#include <iostream>
using namespace std;
int main() {
cout << "Hello World!";
return 0;
}


●    This is a very simple program used to print the message "Hello World!" on the output screen.

●    It gives an idea about the structure and skeleton of a C++ program.

●    #include <iostream> is a header file

●    using namespace std:- std is the standard namespace. cout, cin and lot of other things are defined in it.

●    A special word main, which denote the starting point for execution of the program.

●    All program start their execution from main.

●    Braces are used to start and end every block of the program.

●      { denots start of block

●      } dentos end of block

●    cout is the only executable statement in the above program.

Exercise:-

1. C++ was originally developed by

A. Sir Richard Hadlee
B. Clocksin and Mellish
C. Donald E. Knuth
D. Bjame Stroustrup

View Answer


2. latest C++ standard document was issued by ANSI/ISO in which year?

A. 2011
B. 2013
C. 2015
D. 2017

View Answer


Program

Print Number Entered by User

#include <iostream>
using namespace std;
int main()
{    
    int number;
    cout << "Enter an integer: ";
    cin >> number;
    cout << "You entered " << number;    
    return 0;
}


Output:
Enter an integer: 23
You entered 23





Visit :


Discussion


* You must be logged in to add comment.