SlideShare a Scribd company logo
 Here is a man dumbo which do not perform task
by himself. So we have to give him command and
then he will perform it.
 Similarly , the computer also can’t perform task by
himself until we give him some set of instruction
to perform(command).
 So, computer take some INPUT form user perform
some COMPUTATION then give useful
INFORMATION or DATA.
COMPARING DUMBO WITH
COMPUTER :
#include <iostream>
using namespace std;
int main()
{
/* program code */
return 0;
}
A modern-style C++ program that uses the new-style
headers and a namespace -
#include <iostream>
using namespace std;
int main()
{
/* program code */
return 0;
}
 The new-style headers do not specify filenames.
 They simply specify standard identifiers that might
be mapped to files by the compiler, but they need
not be.
 <iostream>
 <vector>
 <string>, not related with <string.h>
 <cmath>, C++ version of <math.h>
 <cstring>, C++ version of <string.h>
 Programmer defined header files should end in “.h”.
•Computer consist of:
•Main Memory
•Registers
•ALU
•Input
•Output devices
•Disk
•Bus ,etc .
•NOTE: The data is always copied if we take any variable (data)
and perform some operation on it. So there will we always a
GARBAGE VALUE present at address or memory location.
•Computer uses only binary language to perform ANY task or to
store any data.
 In c++ we can use int data type to store a integer
value.
 Int uses 4 byte or 2 byte to store data.
 There are some data type which are used with in to
store data which required less or more storage,
they are:
 Short-2byte
 long-8byte
 unsigned-numbers with positive values only.
 Range = -2^31 to 2^31-1
Example: data type – int – size=4byte(32bits)
Formula:
1.)For signed -2^n to 2^n-1 .
2.)For unsigned 0 to 2^2n -1 .
Here n=number of bits.
n= 32,
-2^32 to 2^32-1 or
0 to 2^64-1 .
•In computer the signed interger is stored in
the form of binary numbers.
•The positive numbers from 0 to infinity the
number will be in its complement form.
• The MSB will 0 for positive and 1 for
negative.
•The remaining part of negative number will be
in its 2’s complement.
1. If the number is starting with 0 then the
number will be in octal.
2. If the number is starting with 0x then the
number will be in hexadecimal.
3. We can define a constant by using const.
•To represent floating numbers in c++ the float
and double data types are used .
•Float – 4byte – 7 digits.
•Double – 8byte – 15 digits.
•To represent string there are three data types
available in c++, they are:
•1. string
•2. char
•3. bool (true or false).
•For every character there is a ASCII value
•E.g. : ‘A’=65 , ‘a’ =97 , ‘0’ =48 etc.
•Range of char= 0 to 255.
•E.g. : char x=‘a’ ;
•In string data type the string “harsh” will be
stored in the from of array .
•E.g. : string =“HARSH”;
•Also,
•E.g. : char arr[6]=“HARSH”;
•Here ‘0’ is the NULL string which signify the
end of the string.
•In boolean, bool data type store only true-1 or
false-0.
H A R S H 0
#include directives
int main()
{
constant declarations;
variable declarations;
executable statements;
return 0;
}
•Compiler directive or Header file : Instruction
to compiler used when compiling our program
to machine language.
•For e.g. iostream , math, etc.
•Using namespace std : every declaration in the
program is stored in a namespace called “std”.
•E.g. std:: name; if declaration is of name.
•We can also our own namespace , when
required.
•Is state that the value(result) of arithmetic
operation depend on more expressive variable.
•E.g. : float a,b;
c=a+b; will be float.
c=a-b; will be float.
c=a/b; will be float……..,etc.
Similarly, 2-2.0 will be float.
Precedence : Operator :
1. ( )
2. *
3. + or -
4. / or %
NOTE : Do not use [] or {} rather than of ().
E.g. : a+b*c/d-e == (a+((b*c)/d))-e
 Escape character ----- ‘’.
•It is use to escape the use of a character if we
put ‘’ in front of a character then the value is
escaped.
•Like if we want to print “ on console then we
have to use ” .
•Similarly ,  ,etc.
•Also to print % on console we have to use
%%.
Precedence : Operators:
1. !
2. < , <= , > , >=
3. == , !=
4. &&
5. ||
•In for( ) or while( ) loop : if there is nothing
then it will assume 1 means it will run the
content of for or while loop.
•For E.g. for(i =0 ; ; i++) ,while( ) ,etc.
•In C++, we can use static members inside a
structure i.e., struct .
•We can also print the address on printf
statement like, printf(“%p”, ” hello world”);
This will print the address on the string.
c++

More Related Content

What's hot

(02) c sharp_tutorial
(02) c sharp_tutorial(02) c sharp_tutorial
(02) c sharp_tutorial
Satish Verma
 
Managing console input
Managing console inputManaging console input
Managing console input
rajshreemuthiah
 
Managing I/O & String function in C
Managing I/O & String function in CManaging I/O & String function in C
Managing I/O & String function in C
Abinaya B
 
C++:Lab 2
 C++:Lab 2 C++:Lab 2
C++:Lab 2
سلمى شطا
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdfc++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
ayush616992
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
shashikant pabari
 
Programming in c
Programming in cProgramming in c
Programming in c
vinothinisureshbabu
 
String C Programming
String C ProgrammingString C Programming
String C Programming
Prionto Abdullah
 
C programming - String
C programming - StringC programming - String
C programming - String
Achyut Devkota
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 
Encoders and types of encodrs
Encoders and types of encodrs Encoders and types of encodrs
Encoders and types of encodrs
Easy n Inspire L
 
C++
C++C++
C programming Tutorial Session 1
C programming Tutorial Session 1C programming Tutorial Session 1
C programming Tutorial Session 1
Muhammad Ehtisham Siddiqui
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
Saifur Rahman
 
C string
C stringC string
String functions in C
String functions in CString functions in C
string in C
string in Cstring in C
Implementation Of String Functions In C
Implementation Of String Functions In CImplementation Of String Functions In C
Implementation Of String Functions In C
Fazila Sadia
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
Lecture 2. mte 407
Lecture 2. mte 407Lecture 2. mte 407
Lecture 2. mte 407
rumanatasnim415
 

What's hot (20)

(02) c sharp_tutorial
(02) c sharp_tutorial(02) c sharp_tutorial
(02) c sharp_tutorial
 
Managing console input
Managing console inputManaging console input
Managing console input
 
Managing I/O & String function in C
Managing I/O & String function in CManaging I/O & String function in C
Managing I/O & String function in C
 
C++:Lab 2
 C++:Lab 2 C++:Lab 2
C++:Lab 2
 
c++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdfc++ exp 1 Suraj...pdf
c++ exp 1 Suraj...pdf
 
Basic concept of c++
Basic concept of c++Basic concept of c++
Basic concept of c++
 
Programming in c
Programming in cProgramming in c
Programming in c
 
String C Programming
String C ProgrammingString C Programming
String C Programming
 
C programming - String
C programming - StringC programming - String
C programming - String
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
Encoders and types of encodrs
Encoders and types of encodrs Encoders and types of encodrs
Encoders and types of encodrs
 
C++
C++C++
C++
 
C programming Tutorial Session 1
C programming Tutorial Session 1C programming Tutorial Session 1
C programming Tutorial Session 1
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
C string
C stringC string
C string
 
String functions in C
String functions in CString functions in C
String functions in C
 
string in C
string in Cstring in C
string in C
 
Implementation Of String Functions In C
Implementation Of String Functions In CImplementation Of String Functions In C
Implementation Of String Functions In C
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
 
Lecture 2. mte 407
Lecture 2. mte 407Lecture 2. mte 407
Lecture 2. mte 407
 

Similar to c++

Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
SONU KUMAR
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
eteaching
 
C++
C++C++
CHAPTER-2.ppt
CHAPTER-2.pptCHAPTER-2.ppt
CHAPTER-2.ppt
Tekle12
 
C tutorials
C tutorialsC tutorials
C tutorials
Amit Kapoor
 
C++
C++C++
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
WondimuBantihun1
 
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
ANUSUYA S
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
GDGKuwaitGoogleDevel
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
Lakshmi Sarvani Videla
 
(8) cpp abstractions separated_compilation_and_binding_part_i
(8) cpp abstractions separated_compilation_and_binding_part_i(8) cpp abstractions separated_compilation_and_binding_part_i
(8) cpp abstractions separated_compilation_and_binding_part_i
Nico Ludwig
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.ppt
FatimaZafar68
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
Abdullah Jan
 
Chap 2 c++
Chap 2 c++Chap 2 c++
Chap 2 c++
Widad Jamaluddin
 
C programming language
C programming languageC programming language
C programming language
Mahmoud Eladawi
 
Advanced+pointers
Advanced+pointersAdvanced+pointers
Advanced+pointers
Rubal Bansal
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
Anonymous9etQKwW
 

Similar to c++ (20)

Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
 
C++
C++C++
C++
 
CHAPTER-2.ppt
CHAPTER-2.pptCHAPTER-2.ppt
CHAPTER-2.ppt
 
C tutorials
C tutorialsC tutorials
C tutorials
 
C++
C++C++
C++
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
C++ Unit 1PPT which contains the Introduction and basic o C++ with OOOps conc...
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
C notes for exam preparation
C notes for exam preparationC notes for exam preparation
C notes for exam preparation
 
(8) cpp abstractions separated_compilation_and_binding_part_i
(8) cpp abstractions separated_compilation_and_binding_part_i(8) cpp abstractions separated_compilation_and_binding_part_i
(8) cpp abstractions separated_compilation_and_binding_part_i
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.ppt
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
Programming using c++ tool
Programming using c++ toolProgramming using c++ tool
Programming using c++ tool
 
Chap 2 c++
Chap 2 c++Chap 2 c++
Chap 2 c++
 
C programming language
C programming languageC programming language
C programming language
 
Advanced+pointers
Advanced+pointersAdvanced+pointers
Advanced+pointers
 
C programming language
C programming languageC programming language
C programming language
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 

Recently uploaded

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 

Recently uploaded (20)

Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 

c++

  • 1.
  • 2.
  • 3.  Here is a man dumbo which do not perform task by himself. So we have to give him command and then he will perform it.  Similarly , the computer also can’t perform task by himself until we give him some set of instruction to perform(command).  So, computer take some INPUT form user perform some COMPUTATION then give useful INFORMATION or DATA. COMPARING DUMBO WITH COMPUTER :
  • 4. #include <iostream> using namespace std; int main() { /* program code */ return 0; }
  • 5. A modern-style C++ program that uses the new-style headers and a namespace - #include <iostream> using namespace std; int main() { /* program code */ return 0; }
  • 6.  The new-style headers do not specify filenames.  They simply specify standard identifiers that might be mapped to files by the compiler, but they need not be.  <iostream>  <vector>  <string>, not related with <string.h>  <cmath>, C++ version of <math.h>  <cstring>, C++ version of <string.h>  Programmer defined header files should end in “.h”.
  • 7.
  • 8. •Computer consist of: •Main Memory •Registers •ALU •Input •Output devices •Disk •Bus ,etc . •NOTE: The data is always copied if we take any variable (data) and perform some operation on it. So there will we always a GARBAGE VALUE present at address or memory location. •Computer uses only binary language to perform ANY task or to store any data.
  • 9.  In c++ we can use int data type to store a integer value.  Int uses 4 byte or 2 byte to store data.  There are some data type which are used with in to store data which required less or more storage, they are:  Short-2byte  long-8byte  unsigned-numbers with positive values only.  Range = -2^31 to 2^31-1
  • 10. Example: data type – int – size=4byte(32bits) Formula: 1.)For signed -2^n to 2^n-1 . 2.)For unsigned 0 to 2^2n -1 . Here n=number of bits. n= 32, -2^32 to 2^32-1 or 0 to 2^64-1 .
  • 11. •In computer the signed interger is stored in the form of binary numbers. •The positive numbers from 0 to infinity the number will be in its complement form. • The MSB will 0 for positive and 1 for negative. •The remaining part of negative number will be in its 2’s complement.
  • 12. 1. If the number is starting with 0 then the number will be in octal. 2. If the number is starting with 0x then the number will be in hexadecimal. 3. We can define a constant by using const.
  • 13. •To represent floating numbers in c++ the float and double data types are used . •Float – 4byte – 7 digits. •Double – 8byte – 15 digits.
  • 14.
  • 15. •To represent string there are three data types available in c++, they are: •1. string •2. char •3. bool (true or false). •For every character there is a ASCII value •E.g. : ‘A’=65 , ‘a’ =97 , ‘0’ =48 etc. •Range of char= 0 to 255. •E.g. : char x=‘a’ ;
  • 16. •In string data type the string “harsh” will be stored in the from of array . •E.g. : string =“HARSH”; •Also, •E.g. : char arr[6]=“HARSH”; •Here ‘0’ is the NULL string which signify the end of the string. •In boolean, bool data type store only true-1 or false-0. H A R S H 0
  • 17. #include directives int main() { constant declarations; variable declarations; executable statements; return 0; }
  • 18. •Compiler directive or Header file : Instruction to compiler used when compiling our program to machine language. •For e.g. iostream , math, etc. •Using namespace std : every declaration in the program is stored in a namespace called “std”. •E.g. std:: name; if declaration is of name. •We can also our own namespace , when required.
  • 19. •Is state that the value(result) of arithmetic operation depend on more expressive variable. •E.g. : float a,b; c=a+b; will be float. c=a-b; will be float. c=a/b; will be float……..,etc. Similarly, 2-2.0 will be float.
  • 20. Precedence : Operator : 1. ( ) 2. * 3. + or - 4. / or % NOTE : Do not use [] or {} rather than of (). E.g. : a+b*c/d-e == (a+((b*c)/d))-e
  • 21.  Escape character ----- ‘’. •It is use to escape the use of a character if we put ‘’ in front of a character then the value is escaped. •Like if we want to print “ on console then we have to use ” . •Similarly , ,etc. •Also to print % on console we have to use %%.
  • 22. Precedence : Operators: 1. ! 2. < , <= , > , >= 3. == , != 4. && 5. ||
  • 23. •In for( ) or while( ) loop : if there is nothing then it will assume 1 means it will run the content of for or while loop. •For E.g. for(i =0 ; ; i++) ,while( ) ,etc. •In C++, we can use static members inside a structure i.e., struct . •We can also print the address on printf statement like, printf(“%p”, ” hello world”); This will print the address on the string.