SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Introduction
Language
email: shujatabbas9@gmail.com
FB/syedshujaatabbaszaidi@fb.com
What is a program
• A sequence of instructions that a computer can
interpret and execute;
– If I tell you the way from IBA Academic Block to
IBA Administration Block … I will tell sequence of
instructions…. Any wrong instruction leads to a
undesired result.
• A program is something that runs on your computer.
In case of MS Windows program is of .EXE or .COM
extensions
• MS Word, Power point, Excel are all computer
programs
2
Introduction to C
• C is a statically typed, compiled, general-
purpose, case-sensitive, free-form programming
language.
• It supports procedural, object-oriented, and
generic programming.
• C is regarded as a middle-level language, as it
comprises a combination of both high-level and
low-level language features
3
Introduction to C++ (Cont..)
• C++ was developed by Bjarne Stroustrup
starting in 1979 at Bell Labs in Murray Hill, New
Jersey.
• C++ is an enhancement to the C language and
originally named C with Classes but later it was
renamed C++ in 1983.
4
Introduction to C++ (Cont..)
Object- Oriented Programming
• C++ fully supports object-oriented programming,
including the four pillars of object-oriented
development:
• Encapsulation
• Data hiding
• Inheritance
• Polymorphism
5
The ANSI Standard
• The ANSI standard is an attempt to ensure
that C++ is portable -- that code you write for
Microsoft's compiler will compile without errors,
using a compiler on a Mac, UNIX, a Windows
box, or an Alpha.
Use of C++
.
• C++ is used by hundreds of thousands of
programmers in essentially every application
domain.
• C++ is being highly used to write device drivers
and other softwares that rely on direct
manipulation of hardware under real-time
constraints
Environment Setup
• Before you start doing programming using C++,
you need the following two softwares available
on your computer.
1. Text Editor
2. C++ Compiler
8
Environment Setup Cont…
• The files you create with your editor are called
source files, and for C++ they typically are
named with the extension .cpp
• C++ compiler, which will be used to compile your
source code into final executable program
9
Writing C++ Programs
• A programmer uses a text editor to create or
modify files containing C++ code.
• Code is also known as source code.
• A file containing source code is called a source
file.
• After a C++ source file has been created, the
programmer must invoke the C++ compiler
before the program can be executed (run).
10
Compiler converts
human readable
language to a
language which is
understandable by
the operating
system/hardware
Examples of
C/C++ compilers
of today:
Visual C++
GCC/G++
DJGPP (open
source for windows
like GCC)
Borland C
Turbo (obsolete
and not
recommended)
11
Program Development
12
Source File
Program Object Code File
Executable File
Preprocessor
Modified Source Code in RAM
Compiler
Linker
Other Object Code Files (if any)
Editor
A Simple C++ Program
#include <iostream.h> //This is preprosessor directive
int main ( ) //this tells the starting point of your
program
{
cout << “Hello World” <<endl ; //print the text on
monitor
return 0 ; //return to operating system
}
13
Note: cout is an object given to you by the creators of C++. This function saves you
From the complexity of writing your own function of how to display text on the computer
Screen. Hence you are more productive with the actual program rather than worrying
About such issues.
Elements of C+ Program
Preprocessor Directive
• Preprocessor Directive tells computer to
load contents of a certain file
• #include
14
Elements of C+ Program
Header file
• Header file contains the implementation
code of the c++ functions and c++
keywords.
• Iostream.h, conio.h, stdio.h
15
Elements of C+ Program
• int main()
– C++ programs contain one or more functions,
exactly one of which must be main
– Parenthesis used to indicate a function
– int means that main "returns" an integer value
– Braces { and } indicate a block
• The bodies of all functions must be
contained in braces
– Braces indicate the block of function in c++
program
16
Elements of C+ Program
• return 0;
– A way to exit a function
– return 0, in this case, means that the program
terminated normally
• Linker
– When a function is called, linker locates it in the
library
– Inserts it into object program
– If function name is misspelled, the linker will
produce an error because it will not be able to
find function in the library
17
Elements of C+ Program
• Parenthesis ()
• Parenthesis are used to declare function.
Example Int main()
• Cout
• Cout is a keyword which displays the
result of program on monitor screen
• Cout<<“hello”;
18
Elements of C+ Program
• Int
• Int is a data type of function or variable
• Semicolon ;
• Semicolon is used to end the program
statement.
• Program Statement
• Program statement or simply statement is the
instruction in c++ programming language
19

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageTarun Sharma
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingRokonuzzaman Rony
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programmingTarun Sharma
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAkshay Ithape
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming Hemantha Kulathilake
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming languagesanjay joshi
 
C programming basics
C  programming basicsC  programming basics
C programming basicsargusacademy
 
C programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakilC programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakilZenith SVG
 
introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)Abhishek Walia
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentationfazli khaliq
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming languageKumar Gaurav
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGJEENA SARA VIJU
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 

Was ist angesagt? (20)

Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
COM1407: Introduction to C Programming
COM1407: Introduction to C Programming COM1407: Introduction to C Programming
COM1407: Introduction to C Programming
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
 
C programming basics
C  programming basicsC  programming basics
C programming basics
 
C PROGRAMMING
C PROGRAMMINGC PROGRAMMING
C PROGRAMMING
 
C programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakilC programming slide day 01 uploadd by md abdullah al shakil
C programming slide day 01 uploadd by md abdullah al shakil
 
introduction to C programming (C)
introduction to C programming (C)introduction to C programming (C)
introduction to C programming (C)
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
C Language
C LanguageC Language
C Language
 
C programming
C programmingC programming
C programming
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Brief introduction to the c programming language
Brief introduction to the c programming languageBrief introduction to the c programming language
Brief introduction to the c programming language
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
C_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 

Andere mochten auch

Front page part-Customer Satisfaction analysis on BUBT
Front page part-Customer Satisfaction analysis on BUBTFront page part-Customer Satisfaction analysis on BUBT
Front page part-Customer Satisfaction analysis on BUBTRizwan Khan
 
Agricultural value chain analysis
Agricultural value chain analysisAgricultural value chain analysis
Agricultural value chain analysisAFAAS
 
Introduction to macroeconomics
Introduction to macroeconomicsIntroduction to macroeconomics
Introduction to macroeconomicsShivam Bindra
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobilesDurairaja
 
Campaign Analysis for Logan
Campaign Analysis for LoganCampaign Analysis for Logan
Campaign Analysis for LoganJitsuLeon
 

Andere mochten auch (9)

Decision making systems
Decision making systemsDecision making systems
Decision making systems
 
Introduccion a Lenguaje HTML, Programacion Web
Introduccion a Lenguaje HTML, Programacion WebIntroduccion a Lenguaje HTML, Programacion Web
Introduccion a Lenguaje HTML, Programacion Web
 
Front page part-Customer Satisfaction analysis on BUBT
Front page part-Customer Satisfaction analysis on BUBTFront page part-Customer Satisfaction analysis on BUBT
Front page part-Customer Satisfaction analysis on BUBT
 
Agricultural value chain analysis
Agricultural value chain analysisAgricultural value chain analysis
Agricultural value chain analysis
 
Introduction to macroeconomics
Introduction to macroeconomicsIntroduction to macroeconomics
Introduction to macroeconomics
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobiles
 
Atención
AtenciónAtención
Atención
 
Campaign Analysis for Logan
Campaign Analysis for LoganCampaign Analysis for Logan
Campaign Analysis for Logan
 
THE WOLVERINE logan
THE WOLVERINE    loganTHE WOLVERINE    logan
THE WOLVERINE logan
 

Ähnlich wie Introduction to C Language (By: Shujaat Abbas)

Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C LanguageSyedShujaatAbbas
 
Basics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxBasics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxCoolGamer16
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxNEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJmeharikiros2
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...bhargavi804095
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docMayurWagh46
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...bhargavi804095
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itPushkarNiroula1
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++Vaibhav Khanna
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThAram Mohammed
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 

Ähnlich wie Introduction to C Language (By: Shujaat Abbas) (20)

Introduction to C Language
Introduction to C LanguageIntroduction to C Language
Introduction to C Language
 
Csc240 -lecture_3
Csc240  -lecture_3Csc240  -lecture_3
Csc240 -lecture_3
 
Basics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxBasics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptx
 
Session 1 - c++ intro
Session   1 - c++ introSession   1 - c++ intro
Session 1 - c++ intro
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Introduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to itIntroduction to cpp language and all the required information relating to it
Introduction to cpp language and all the required information relating to it
 
Object oriented programming 7 first steps in oop using c++
Object oriented programming 7 first steps in oop using  c++Object oriented programming 7 first steps in oop using  c++
Object oriented programming 7 first steps in oop using c++
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
Whole c++ lectures ITM1 Th
Whole c++ lectures ITM1 ThWhole c++ lectures ITM1 Th
Whole c++ lectures ITM1 Th
 
Learn C Language
Learn C LanguageLearn C Language
Learn C Language
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
C_Intro.ppt
C_Intro.pptC_Intro.ppt
C_Intro.ppt
 
Unit ii
Unit   iiUnit   ii
Unit ii
 

Kürzlich hochgeladen

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 

Kürzlich hochgeladen (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 

Introduction to C Language (By: Shujaat Abbas)

  • 2. What is a program • A sequence of instructions that a computer can interpret and execute; – If I tell you the way from IBA Academic Block to IBA Administration Block … I will tell sequence of instructions…. Any wrong instruction leads to a undesired result. • A program is something that runs on your computer. In case of MS Windows program is of .EXE or .COM extensions • MS Word, Power point, Excel are all computer programs 2
  • 3. Introduction to C • C is a statically typed, compiled, general- purpose, case-sensitive, free-form programming language. • It supports procedural, object-oriented, and generic programming. • C is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features 3
  • 4. Introduction to C++ (Cont..) • C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in Murray Hill, New Jersey. • C++ is an enhancement to the C language and originally named C with Classes but later it was renamed C++ in 1983. 4
  • 5. Introduction to C++ (Cont..) Object- Oriented Programming • C++ fully supports object-oriented programming, including the four pillars of object-oriented development: • Encapsulation • Data hiding • Inheritance • Polymorphism 5
  • 6. The ANSI Standard • The ANSI standard is an attempt to ensure that C++ is portable -- that code you write for Microsoft's compiler will compile without errors, using a compiler on a Mac, UNIX, a Windows box, or an Alpha.
  • 7. Use of C++ . • C++ is used by hundreds of thousands of programmers in essentially every application domain. • C++ is being highly used to write device drivers and other softwares that rely on direct manipulation of hardware under real-time constraints
  • 8. Environment Setup • Before you start doing programming using C++, you need the following two softwares available on your computer. 1. Text Editor 2. C++ Compiler 8
  • 9. Environment Setup Cont… • The files you create with your editor are called source files, and for C++ they typically are named with the extension .cpp • C++ compiler, which will be used to compile your source code into final executable program 9
  • 10. Writing C++ Programs • A programmer uses a text editor to create or modify files containing C++ code. • Code is also known as source code. • A file containing source code is called a source file. • After a C++ source file has been created, the programmer must invoke the C++ compiler before the program can be executed (run). 10
  • 11. Compiler converts human readable language to a language which is understandable by the operating system/hardware Examples of C/C++ compilers of today: Visual C++ GCC/G++ DJGPP (open source for windows like GCC) Borland C Turbo (obsolete and not recommended) 11
  • 12. Program Development 12 Source File Program Object Code File Executable File Preprocessor Modified Source Code in RAM Compiler Linker Other Object Code Files (if any) Editor
  • 13. A Simple C++ Program #include <iostream.h> //This is preprosessor directive int main ( ) //this tells the starting point of your program { cout << “Hello World” <<endl ; //print the text on monitor return 0 ; //return to operating system } 13 Note: cout is an object given to you by the creators of C++. This function saves you From the complexity of writing your own function of how to display text on the computer Screen. Hence you are more productive with the actual program rather than worrying About such issues.
  • 14. Elements of C+ Program Preprocessor Directive • Preprocessor Directive tells computer to load contents of a certain file • #include 14
  • 15. Elements of C+ Program Header file • Header file contains the implementation code of the c++ functions and c++ keywords. • Iostream.h, conio.h, stdio.h 15
  • 16. Elements of C+ Program • int main() – C++ programs contain one or more functions, exactly one of which must be main – Parenthesis used to indicate a function – int means that main "returns" an integer value – Braces { and } indicate a block • The bodies of all functions must be contained in braces – Braces indicate the block of function in c++ program 16
  • 17. Elements of C+ Program • return 0; – A way to exit a function – return 0, in this case, means that the program terminated normally • Linker – When a function is called, linker locates it in the library – Inserts it into object program – If function name is misspelled, the linker will produce an error because it will not be able to find function in the library 17
  • 18. Elements of C+ Program • Parenthesis () • Parenthesis are used to declare function. Example Int main() • Cout • Cout is a keyword which displays the result of program on monitor screen • Cout<<“hello”; 18
  • 19. Elements of C+ Program • Int • Int is a data type of function or variable • Semicolon ; • Semicolon is used to end the program statement. • Program Statement • Program statement or simply statement is the instruction in c++ programming language 19