Está en la página 1de 3

Submitted by:

Ma. Clarissa D. ham


Submitted to:
Mr. Albert Reyes

DEFINITION

C++ is an object oriented programming (OOP) language, developed by Bjarne Stroustrup, and
is an extension of C language. It is therefore possible to code C++ in a "C style" or "objectoriented style." C++ is a general purpose object oriented programming language. It is
considered to be an intermediate level language. C++ is statically type, compiled, gnereal
purpose ,case sensitive, free-form programming language that supports procedural, object
oriented and generic programming.

INTRODUCTION

C++ was developed by Bjarne Stroustrup of AT&T Bell Laboratories in the early 1980's,
and is based on the C language. The "++" is a syntactic construct used in C (to increment a
variable), and C++ is intended as an incremental improvement of C. Most of C is a subset of
C++, so that most C programs can be compiled (i.e. converted into a series of low-level
instructions that the computer can execute directly) using a C++ compiler. C++ is superset
of C , and that virtually any legal C program is a legal C++ programs.

USES

C++ used by hundreds of thousands programmer is essential every application domain. C++
is being highly used to write device drivers and other software that rely on direct
manipulation of hardware under real time constraints. C++ is widely used for teaching and
research because it is clean enough for successful teaching of basic concepts.

SAMPLE CODES
// The Hello world program.
// pg 46, sec 3.2, Hello, World!
// No guarantees offered. Constructive comments to bs@research.att.com
#include <iostream>
int main()
{
std::cout << "Hello, world!\n";
}
// note that "return 0;" isn't required in ISO C++

// Simple inch<->cm conversion program illustrating basic I/O and computation.


// pg 50, sec 3.6, Input
// No guarantees offered. Constructive comments to bs@research.att.com

#include<iostream>
using namespace std;
int main()
{
const float factor = 2.54;
float x, in, cm;
char ch = 0;

// 1 inch equals 2.54 cm

cout << "enter length: ";


cin >> x;
cin >> ch;

// read a floating-point number


// read a suffix

switch (ch) {
case 'i':
// inch
in = x;
cm = x*factor;
break;
case 'c':
// cm
in = x/factor;
cm = x;
break;
default:
in = cm = 0;
break;
}
cout << in << " in = " << cm << " cm\n";
return 0;
}

// redundant in ISO C++

También podría gustarte