0% found this document useful (0 votes)
11 views12 pages

Lec 3

Uploaded by

humnashaikh078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views12 pages

Lec 3

Uploaded by

humnashaikh078
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

History of C++ 33

1843 1972
AdaLoveLace Birth of C
• First program on paper • Bell Telephone Laboratories, Dennis
• Built for Difference Engine Ritchie

Birth of OOP
• C++(Bjarne Stroustrup)
Assembly Language • C incremented
• Simplified the 0’s and 1’s • Released in 1985

1949 1983
34
What is C++

 C++ is a cross-platform, object


oriented language that can be
used to create high-performance
applications.
 C++ is used in developing
browsers, operating systems,
and applications, as well as in-
game programming,
IDE 35

 For writing C++ Programs we need a Code Editor and Compiler


 “A software that provides programming environment to facilitate
programmers in writing and executing a computer programs is
known as IDE.”
 An IDE has Graphical user interface and it helps the programmers, in
writing, executing and testing a computer program
 Visual Studio, Xcode and DevC++ are some famous IDE for C++
Language
Installing DevC++ 36
37
Polya’s 4 Steps of
Problem Solving
 Problem Solving Phase
 U – Understand the Problem
 D – Devise a Good Plan to Solve
 Implementation Phase
 I – Implement the Plan
 E – Evaluate the Solution
38

 A sequence of precise instructions which leads to


a solution is called an algorithm.

 Some approximately equivalent words are recipe,


method, directions, procedure, and routine.

Algorithm
First Program in C++ 39

 #include<iostream>
 using namespace std;
 int main(){
cout<<“Hello World”;
return 0;
}
8.3.2 Structure of C++ Program 40

 Structure of C++ Program:


 Format of Writing C++ Program
a. Preprocessor Directives 41

Begin with # Symbol like


#include, #define etc

Used to include header


files, like stdio.h, conio.h
etc or to define
constants like #define
max 10

Placed at the top of C++


Program
b. Main Function 42

Special Function, Entry Point Starts the execution of


for every C++ Program program

void main(){} returns int main(){return 0;}


nothing returns 0
b. Main Function (Body) 43

 Body of Main Function starts after opening


curly brackets and ends before closing
curly brackets, It may contain:
 Statements
 Variable Declarations
 Calling of Functions
 Return Statement
 Comments
Features of C++ Language

C++ is considered as High level language.

C++ is case sensitive language.

C++ has compiler as a language translator.

C++ is hybrid language (Combination of structured as


well as Object orientation paradigm)

You might also like