####ìÍ##=Eu#øÍ##ˆþ##ˆþ##½Ou#Eu#####ˆþ##ìÍ##ìÍ##°###$Î##½#######Þ##ÝDu#øÍ#####NˆÞ¢º#Í#Ô#ÔæiKÃ# #à3ˆ#Í######Ò######ˆ# @new c...
Ï##ä#######Ô#######$Ï###Tˆ|
Ï##Ô###############¨Ï## ###ÔWhôÏ##¡Wˆ|@Ð##########°Ï## ###NEWC__~1.DOC##%#ôÑ##U_ˆ|j!ˆ|#üýˆˆ_ˆ|øûýˆ##%#####ÈÏ##´Ï##hÏ## ###...
Ñ###Rˆ|4Ñ##ä#######Ô#######LÑ###Tˆ|4Ñ##Ô###PÑ########ˆ|E###x#########(Ñ##hÒ##lÓ###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|#### Ö##xÖ##j!ˆ|#...
×####ˆ|##ˆ|[8##ÌÒ##xÖ##
Ö###éˆ| Ö## Ó########ˆ|E###x####### ##xÓ##ˆBˆ|¼Õ###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|#Ù###Ù##ØØ##########À#Éq[8####Éq0#######x#Éq#?ˆ|...
###HÖ##DÖ######
###ˆ###NÖ####ˆ|ÔÕ########ˆ|####x#######ˆ###¬Õ######ð×###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|Ä=##°=#############$####ðýˆ#######@ˆ|#####Ù...
#ˆ|Ä=######ˆØ##ïˆ|Ä=##õ ˆ|ÀÛ##ˆÛ##5îˆ|¬###$Þ######Hîˆ|#########Ù##@###########ÀÛ###üýˆ ######´ ##########`########üýˆ#####...
#2########@ˆ|#####ð## ##ìÝ##jäˆ|LЈ|xäˆ|ðÚ#########ˆ#########Eu##########$ˆ|ôäˆ|?###########################ˆ#ÿÿ@ÿÿÿÿÿÿˆn=...
input and output in the variable.Name/Length of variable (Naming rules)ˆ Firstcharacter of the variable must be alphabet (...
repeated operand.+= Addition Assignment operator-= Subtraction Assignment operator*= Multiplication Assignment operator/= ...
num;temp = num;d4 = num % 10;num = (num-d4) / 10;d3 = num % 10;num = (num -d3) / 10;d2 = num % 10;num = (num - d2) / 10;d1...
Example:NOT TRUE = FALSENOT FALSE = TRUE.13Example: Using OR operators# include<iostream.h># include <conio.h>void main(vo...
+){if (num % a == 0)div = div + 1;}if (div <= 2)cout << ˆPrime number" << num;elsecout << ˆNot a prime number" << num;getc...
C++ code that performs a specific task and optionally returnsa value to thecalling program. Functions are easy to use; the...
Reference A reference provides an alias (different name) for a variable. Whenthe arguments are passed byreference, instead...
which it is defined is executing. The idea behindlimiting lifetime of variablesis to save memory space. If a function is n...
<< "Age : " << age<< "Fee : " << fee;}.29};void main(void){student s1,s2,s3;s1.assign_values(10,20,70.0);s2.get_input();s3...
allowed.Example: # include <iostream.h># include <conio.h>class myclass{private:int rno;public: myclass(void){cout << endl...
endl << "After Reverse" << endl ;for(a=0;a<=9;a++)cout << "Data " << a << " is "<< data[a] << endl;getch();}Initializing A...
# include <conio.h># include <iostream.h>void main(void){ char text[10];clrscr();cout << "Enter Text ";cin.get(text,10, ˆ#...
shopping_mall{private:int shops[50];public:void assign(int income,int shop){shops[shop] = income;}void display(int shop){c...
t.months;temp.days = days + t.days;if (temp.days > 30){temp.months++;temp.days =temp.days - 30;}return temp;}void display(...
###
##ç##÷##û#####¯###Á###W###e###}###ˆ###g###|#######(###+###0###3###6###l###ˆ###L###N###u###¶###¸###Á###Ã###î#######ùèùäèùäè...
?ý##hû###CJ##OJ##QJ##^J##aJ#####h
?ý##hû###CJ##OJ##QJ##^J### #h
?ý##hû###CJ #OJ##QJ##^J##aJ###&#h
?ý##hû###5#ˆCJ   #OJ##QJ###ˆ^J##aJ###&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hˆBÜ## #h
?ý##hû###CJ##OJ##QJ##^J##aJ###
#h
?ý##hû###.####+###4###[###È###Ï###@ ##Z   ##c   ##ˆ   ##ˆ   ##æ   ##ë   #####V##Â##1###ˆ###
##|
##ó
##T##Ç##5###ˆ###÷###b###ú############õ############ì############ì############ç############ì############ì############ç######...
?ý##hû###5#ˆCJ
#OJ##QJ###ˆ^J##aJ#####h
?ý##hû###CJ##OJ##QJ##^J#####h#KJ##&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ###
#h
?ý##hû####&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ##(r###ˆ###·###¹###¾###À###á##########*###3###ˆ#######ˆ###¥###Ü###########/###`###ˆ###õ#######C...
?ý##hû###CJ##OJ##QJ##^J###,#h
?ý##hû###5#ˆ6#ˆCJ##OJ##QJ###ˆ]#ˆ^J##aJ###&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####h1R##hû###0J### #h
?ý##h1R#CJ##OJ##QJ##^J##aJ#####hû###CJ##OJ##QJ##^J##aJ###&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ### #h
?ý##hû###CJ
#OJ##QJ##^J##aJ##"d%##t%##v%##}%##ˆ%##ˆ%##ˆ%##ˆ%##²%##Â%##Ä%##Ë%##Ò%##ì%###&##&##*&##ˆ&##ˆ&##¥&##³&##È&##õ&##
####0##2##M##a##ö############ö############ö############ö############ö############ö############ö############ö############ö#...
&.#   ##7$#8$#H$#gdû#####&##*&##+&##ˆ&##¥&##¶&##·&##2##M##q(##ˆ(##Û(##à(##))##0)##ˆ*##±*##Ï*##Ó*##ˆ+##ˆ+###,##     ,##,###...
?ý##hû###CJ##OJ##QJ##^J#####hö(ˆ#CJ##OJ##QJ##^J##aJ#####hF#~#CJ##OJ##QJ##^J##aJ###&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hu#Î####h
?ý##hû###OJ##QJ##^J#####h4Rˆ#OJ##QJ##^J###
#h
?ý##hû######hFEí#CJ##OJ##QJ##^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ###&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ#####h
&.#(a##{##ˆ##¡##Ì##Õ##×##)(##1(##N(##(##q(##å(##))##ˆ)##ÿ)##r*##ˆ*##±*##(+##ˆ+###,###,##!,##6,##L,##j,##ˆ,##ö############ö...
=##!=##ˆ=##ˆ=##ˆ=## =##±=##²=##³=##·=##ïÛïÛïÛïÒÛÁïºï«º§ïºïºïÛïÛïÛïˆïÛï«ïÛïÛïÛïÛïÛïÛïÛïÛïÛï«ÒÛÁï##########&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hi8~####h
?ý##hû###CJ##OJ##QJ##^J###
#h
?ý##hû#### #hi8~#5#ˆCJ##OJ##QJ###ˆ^J##aJ#####hi8~##hû###0J###&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ##8Å/##Î/##Ð/##Ò/##ò/##=0##®0##1##u1##ˆ1##¸1##Þ1##þ1###2##-2##R2##w2##ˆ2###3###3##93##a3##ˆ3##¨...
=##!=##J=##ˆ=##ˆ=##ˆ=## =##³=##ï=###>##(>##@>##´>##ö############ö############ö############ö############ö############ö#####...
?ý##hû###CJ##OJ##QJ##^J###&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ### #h
?ý##hû###CJ##OJ   #QJ   #^J   #aJ#####hÎ_,##
#h
?ý##hû####&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ### #h
?ý##hi8~#CJ##OJ##QJ##^J##aJ##%´>##¾>##Þ>##0?##¢?##³?##É?##Þ?##÷?###@##l@##â@##ë@##      A###A###A##ˆA##ˆA##ªA##ÁA##ÑA##ÓA#...
K###K##SK##]K##ˆK##êK##.L##ûL##M###N###N##"N##%N###O###O###O###O##0O##4O##ˆO##ÂO###P###P##ÅQ##ÍQ##ÐR##àR##ßS##âS##ëS##ÁT##...
#h
?ý##hû####&#h
?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####h
?ý##hû###CJ##OJ##QJ##^J###&#h
?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###,#h
?ý##hû###5#ˆ6#ˆCJ##OJ##QJ###ˆ]#ˆ^J##aJ### #h
?ý##hû###CJ##OJ##QJ##^J##aJ####hÎ_,#5#ˆCJ##OJ##QJ###ˆ^J##aJ##6ÅG##ÇG##ÏG##æG##úG##H##
H###H###H##8H##DH##TH##VH##fH##hH##ˆH##ˆH##ˆH##ˆH##¤H##ôH###I###I##/I##1I##:I##DI##fI##tI##ö############ö############ö####...
K##SK##ˆK##ˆK##áK##.L##EL##YL##mL##}L##ˆL##ˆL##ˆL##®L##¼L##ÏL##ùL##ûL##M##ˆM##ö############ö############ö############ö####...
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
c++
Upcoming SlideShare
Loading in …5
×

c++

763 views
576 views

Published on

THIS MAY HELPP U DUDE

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
763
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

c++

  1. 1. ####ìÍ##=Eu#øÍ##ˆþ##ˆþ##½Ou#Eu#####ˆþ##ìÍ##ìÍ##°###$Î##½#######Þ##ÝDu#øÍ#####NˆÞ¢º#Í#Ô#ÔæiKÃ# #à3ˆ#Í######Ò######ˆ# @new c++08.doc#c#s.doc#g#Visual.Basic.2010.Mar.2010.pdf#d Database ApplicationsComprehensive.pdf#s_files#d from over 100 stock photo companies_files#ˆ|ØÎ###³ˆ|üÎ##äÎ###Rˆ|
  2. 2. Ï##ä#######Ô#######$Ï###Tˆ|
  3. 3. Ï##Ô###############¨Ï## ###ÔWhôÏ##¡Wˆ|@Ð##########°Ï## ###NEWC__~1.DOC##%#ôÑ##U_ˆ|j!ˆ|#üýˆˆ_ˆ|øûýˆ##%#####ÈÏ##´Ï##hÏ## #######¸Ï##ÍUˆ|ˆÏ##Ȳˆ|´Ï##¬Ï###Ð##èÐ##############ˆÒ##########################,###|Ð##Ɉ|######## ###@Ð##ÜÏ##`³ˆ|]ˆ|@##############################################################################HÐ##########¨Ð##########üýˆ[8######ßXˆ|####tÐ##tÐ##tÐ##########¬Ð##¼êˆ|####[8##äÑ###Ñ##äÑ##Ø[ˆ|ÐÐ##øûýˆ##%#=ˆ|þjˆ|`³ˆ|ˆ#%#####øûýˆ@Ò######ˆÒ######ðÔ######@Ñ##################üýˆ#####Ñ##########
  4. 4. Ñ###Rˆ|4Ñ##ä#######Ô#######LÑ###Tˆ|4Ñ##Ô###PÑ########ˆ|E###x#########(Ñ##hÒ##lÓ###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|#### Ö##xÖ##j!ˆ|#üýˆˆ_ˆ|øûýˆˆ/%#####ðÑ##ÜÑ##ˆÑ## #######àÑ##ÍUˆ|¸Ñ##Ȳˆ|ÜÑ##ÔÑ##DÒ###Ó##############¸Ô##########################,###¤Ò##Ɉ|######## ###hÒ###Ò##`³ˆ|]ˆ|@##########################################################################ˆ#A~####¯#A~####ÐÒ##########üýˆ[8######ßXˆ|####ˆÒ##ˆÒ####ˆ|##ˆ|üÕ##$###èÓ##gˆˆ|üÒ### ýˆ##ˆ|ˆÒ######`Ó###éˆ|@#ˆ|#ֈ|)@ˆ|#@ˆ|#### Ö##xÖ##0####Ô##àˆÝw#Ô###Ô##òÓ###Ô##########0#2#ÜÖ######dÔ##ÜÖ######0###E###ˆ###0###########$Ô##########ôÓ##############
  5. 5. ×####ˆ|##ˆ|[8##ÌÒ##xÖ##
  6. 6. Ö###éˆ| Ö## Ó########ˆ|E###x####### ##xÓ##ˆBˆ|¼Õ###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|#Ù###Ù##ØØ##########À#Éq[8####Éq0#######x#Éq#?ˆ|0#2#ÜÖ##ôÓ########Ô#####.##P#I#P#E##D#A#V# #R#P#C##S#E#R#V#I#C#E#################################################################################################################°Ô###Rˆ|ØÔ##ä#######Ô#######ðÔ###Tˆ|ØÔ##ˆÓˆ|ˆ#ˆ|©###############ôÔ##(# #####################hCˆ|#########Õ##܈ˆ|ˆ#######@#ˆ|#ֈ|)@ˆ|#@ˆ|#####Ù##ØØ######4Õ## #######ˆÕ##BÖ##Õ###############üýˆ#Ù#######üýˆ########E###################PÖ##
  7. 7. ###HÖ##DÖ######
  8. 8. ###ˆ###NÖ####ˆ|ÔÕ########ˆ|####x#######ˆ###¬Õ######ð×###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|Ä=##°=#############$####ðýˆ#######@ˆ|#####Ù##########PÖ######TÖ########ˆ|####Ø#######°=##,Ö## ###pØ###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|õ ˆ|ÀÛ######################################################################################################################################################################################################################################################################################Ù#ˆ|Ä=##ˆ###################################################ì×########ˆ|E###x####### ##Ä×#######Ú###éˆ|#Ø########ˆ|E###x####### ##ð×##¶#ˆ|4Ú###éˆ|DØ########ˆ|E###x####### ###Ø##XØ##`Ú###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|####ˆÝ######8##########`Ö##ˆÕˆ|ˆþ###éˆ|ˆØ##
  9. 9. #ˆ|Ä=######ˆØ##ïˆ|Ä=##õ ˆ|ÀÛ##ˆÛ##5îˆ|¬###$Þ######Hîˆ|#########Ù##@###########ÀÛ###üýˆ ######´ ##########`########üýˆ############´##С##ˆÓˆ|ˆ#ˆ|©###############@Ù##(# #############ˆÓˆ|ˆ#ˆ|©###############lÙ##(# ###########ˆ|½Ou###@###@###@#`Ù######ˆÙ##e#ˆ|##@#########¼Ù####ˆ|½Ou###ˆ|#Ý##à#ˆ|ˆÙ######ÀÝ###éˆ|##ˆ|ÿÿÿÿ##ˆ|ì^ˆ|#«ˆ|x±ˆ|####ÀÝ######ìÝ##jHúˆ#Pu##Ú##¨2ˆ|ÐÚ##ÀÝ##ðÚ##¤Ú##ÀÝ##¼2ˆ|ÀÝ##¸Ú##z2ˆ|ÐÚ##ÀÝ##ðÚ##¤Ú##½Ou#####ÐÚ##ÀÝ##煮|ÐÚ##ÀÝ##ðÚ##¤Ú##½Ou#####ÐÚ##ˆþ###Ý###éˆ|ˆÝ#######Ý###Bˆ|¨ ##èÚ##@#ˆ|#ֈ|ÇBˆ|ˆBˆ|>###(×##################
  10. 10. #2########@ˆ|#####ð## ##ìÝ##jäˆ|LЈ|xäˆ|ðÚ#########ˆ#########Eu##########$ˆ|ôäˆ|?###########################ˆ#ÿÿ@ÿÿÿÿÿÿˆn=w##"#H#=w##ÿÿp#"#ô×##P###########D###A#p#p#a#t#i#o#n#l#e###M#F#p#p#l#i#c########ˆÿ?#######ˆÿ?########;###############ˆþ##°=##ôäˆ|#$ˆ|####ìÝ###Pu#####F###¼Ý######ˆ#@##"#ˆn=w####H#=w##ÿÿˆ###ÿÿ##p#"#ô×##P#######################D###A#p#p#######a#t#i#o#n#######l#e###M#F#######p#p#l#i#c##############ˆÿ?#############ˆÿ?##########,Ù##¬Ü#C########,Ù##¬Ü#C########ÖÜ##ˆ4##ÀØ##{pÝw´###´Ø##ØØ##p#"#ÐØ##ÈØ##´########à######H8÷w####8Ý##·BöwD###H8÷wD###dÝ#######à##dÝ###à##ÂBöwdÝ##########p#"##à##¬Þ##ˆ#######ÿÿÿÿÅoˆ|ˆ#ˆ#LÜ##,Ù######x>##ì###C#:##D#o#c#u#m#e#n#t#s##a#n#d##S#e#t#t#i#n#g#s##A#d#m#i#n#i#s#t#r#a#t#o#r##>,##ÄÚ##ÄÚ##ÐCöwÿÿ###Û###########æ##øˆˆ|ÝCöwøˆˆ|########òOu#ÞOu#ˆþ##ˆþ##½Ou##Eu#####ˆþ##ìÝ##ìÝ##°=###ֈ|Uéˆ|#####Þ##ˆDu#PÞ######ˆþ###Þ###Þ##°=##PÞ##½##C++Dî##ÔDu#PÞ######Üá# º#Í#ú·#Lˆ§Ä#ˆçˆèiKÃ#############ˆ# @C++ Hazrat Ali NasarNots#hm#eference.May.2008.pdf## ###`#°ÜÞ##¡Wˆ|Àß##########0ß## ######Àøûýˆˆ#%#¼#%#tá##U_ˆ|ôÞ########ˆ|E###x####### ##ÌÞ##èÞ###á###éˆ|##ˆ|ÿÿÿÿ##ˆ|{#ˆ|»#ˆ|#ß###Rˆ|Dß##ä#######Ô#######ß###Tˆ|Dß##Ô###############àß## ###ÔWhôˆß##¡Wˆ|xà######C__HAZ~1#TXT###Àøûýˆ##%#T#%#,â##U_ˆ|j!ˆ|#üýˆˆ_ˆ|øûýˆ##%######à##ìß## ß#########ðß##ÍUˆ|Èß##Ȳˆ|ìß##äß##Tà## á##############Èâ############## languagecalled ˆC with Classesˆ. Rick Mascitti suggested the name C++.Event YearDescriptionC with Classes 1979-1983 Adding classes with a preprocessorEvolutionof C++ 1882-1985 First Commercial releaseRelease 2.0 1985-1988 Early CommercialuseGrowth in Use 1987 Large Scale UseStandardization 1988Basic Feature of C++1.It is the super set/extension of C language, it supports almost every feature ofC language, additionally it has itsown distinguish features.2. C++ is a general-purpose object oriented programming language.3. C++ is case sensitive language.4. C++ is a language of few words.5. Almost every statement is terminated withsemicolon.6. C++ is statement-oriented language.7. Every C++ language programhas a extension .cpp or .cxx or .C8. Require explicit inclusion of relatedheader file.Advance Features of C++1. Classes and Objects.2. Derived Classes.3.Private/public access control.4. Constructors and Destructors.5. Friend classes.6. Inline function.7. Default argument.8. Overloading of operators..2Major StepsIn C++ Program DevelopmentC++ programs typically go through several phases to beexecuted.ˆ Editing. The first phase consists of editing a file. This isaccomplished with an editor program. The programmertypes a C++ program with theeditor and makes the correction if necessary. The program is then often storedonsecondary storage device such as a disk.ˆ Compile. In this phase theprogrammer gives the command to compile the program. The compiler translates theC++ program, into object code. In C++ system, a Preprocessor program executesautomatically before thecompilerˆs translation phase begins. The C++preprocessor obeys special commands called preprocessordirectives whichindicates that certain manipulation usually are to be performed on the programbefore thecompilation.ˆLinking. The file generated by the compiler is not a pureexecutable file so it cannot be executed by the computedirectly. Rather specialprogram called the Linker is required that link the intermediate file withlibrary routinesstored in a files with the .lib extension. After linking theintermediate file the linker generate the executable file(.exe) that can beexecute by computer.ˆ Executing After the successful compilation and linking ofprogram we receive the executable file that can beexecuted by the user.Thelayout/Structure of C++ ProgramsThe general form of a C++ program is as followspreprocessor directivesglobal declarationsclass definitionmain() {localvariables to function main ;statements associated with function main ;}f1(){local variables to function1 ;Statements associated with function1;}f2(){localvariables to function f2 ;statements associated with function 2 ;}BASICCOMPONENTS OF C++ PROGAMVARIABLE Variable may be the most fundamental aspect ofany computer language. A variable is a space in thecomputerˆs memory set asidefor a certain kind of data and given a name for easy reference. Variables areused so thatthe same space in memory can hold different values at differenttimes. Before using the variable it is necessary tocreate it with the propercommand.There are several issues associated with the variable:1. Name/Length ofvariable (Naming rules).2. Type of variables.3. How to create.4. How to take
  11. 11. input and output in the variable.Name/Length of variable (Naming rules)ˆ Firstcharacter of the variable must be alphabet (a to z| A to Z) or underscore, whilethe remaining may bedigits, alphabet or underscore.ˆ No blank is allowed withina variable name.ˆ In some compiler the length of the variable is 8 characters,some compilers allow variable names whoselength could be up to 40 or 256character, but the latest compiler impose no restriction on the length ofthevariable name.Example of Valid Variable Name:Age fname _abc _123 age123Exampleof Invalid Variable Name:9num age$.3Type of variables While declaring thevariable it is necessary to specify its type.DATA TYPE DESCRIPTION SIZE RANGEsigned int Store integer values with nofractional part2 bytes -32768 to32768unsigned int Store integer values with nofractional part2 bytes 0 to 65535singedlong Store large integer values with nofractional part4 bytes -2147483848to2147483647unsigned longlongStore large integer values with nofractional part4bytes 0 to4294967295float Store float value 4 bytes -3.4e38 to3.4e387 mantissadouble Store large float value 8bytes-1.7e308 to1.7e30815 mantissalong doubleStore very large float value 10bytes-3.4e4932 to+1.1e493219 mantissachar Storesingle quote enclosed withinthe quotes1 byte----Creating Variableˆ int age;ˆ intage = 5;ˆ float profit = 78.56;ˆ char grade = ˆAˆ;ˆ int a,b,c;ˆ int a = 5, b =7, c = 9;Displaying the content of VariableThe identifier cout is used fordisplaying the value of variable and other messages. cout is actually an object.It ispredefined in C++ to correspond to the standard output stream. A stream isa system that refers to a flow of data. Thestandard output stream normally flowsto the screen display. With cout and operator << (insertion or put to operator)is used. It directs the content of the variable on its right to the object onits left. Necessary information about cout isincluded in iostream.h file.Program1: Display the contents of the variable.# include <iostream.h>voidmain(void){int a;a = 5;cout << a;}Program2:# include <iostream.h>void main(void){int a;a = 5;cout << ˆvalue of a is ˆ;cout << a; // or cout << ˆvalue of a is ˆ<< a;}.4CONSTANTS Constant is an identifier having a value that cannot be duringthe execution of program.Syntax:const type name = value;For instance:const floatg = 9.8;Example: Read mass and calculate the weight.# include <iostream.h>#include <conio.h>void main(void){const float gravity = 9.8;float mass, weight;cout << "Enter Mass : " ;cin >> mass;weight = mass * gravity;cout << "CalculatedWeight is " << weight;getch();}In C++ constants can also be specified using thepreprocessor directive # define.Syntax:# define constant_name valueFor instance:# define gravity 9.8The endl Manipulator endl manipulator causes a linefeed tobe inserted into the stream. Strictly speaking endl alsocauses the output bufferto be flushed, but this happens invisibly.COMMENTS. Comments are an importantpart of any program. They help the person writing the program andanyone who mustread the source file. The compiler ignores comments. So they do not add to theexecutable file.Comments starts with a double slash // and terminate at the endof line. C++ also support C language comments thatbegin with the /* and endswith */.Taking Input In Variables:To read the data in variable, cin object isused. The cin is predefined in C++ to correspond input stream. This streamdatarepresent data coming from the keyboard. The >> is the extraction or get fromoperator is used with cin object.Its takes the value from the stream objects onits left and places it in the variable on its right.OPERATORSArithmeticOperators.Assignment Operator.Relational Operators.Increment/Decrement OperatorsLogical Operators / Boolean OperatorsArithmetic Operators Operators are symbolsthat perform some particular action on operands.+ - * / %Program1 Readtemperature in Fahrenheit and Convert in into Celsius.# include <iostream.h>#include <conio.h>void main(void){int farsen, cel;clrscr(); // associate headerfile is conio.hcout << "Enter Temperature ";cin >> faren;cel = (faren ˆ 32) *5 / 9; or f=(c*9/5)+32cout << "Equivalent Temperature In Celsius Is ˆ <<cel;getch();}.5Program1 Read three numeric values in int type variables usingone cin.# include <iostream.h># include <conio.h>void main(void){int n1,n2,n3;clrscr(); // associate header file is conio.hcout << "Three Numeric Values ";cin>> n1 >> n2 >> n3;clrscr();cout << "First Value is " << n1 << endl<< "SecondValue is " << n2 << endl<< "Third Value is " << n3;getch();}.ArithmeticAssignment Operator If we compare a C program with a program with a similarpurpose written inanother language, you may well find that the C source file isshorter. One reason for this is that C has severaloperators that can compressoften-used programming such as the arithmetic assignment operators, whichcombines anarithmetic operator, and an assignment operator and eliminates the
  12. 12. repeated operand.+= Addition Assignment operator-= Subtraction Assignment operator*= Multiplication Assignment operator/= Division Assignment operator%=Remainder Assignment operatorFor instance:A = A + 1; can be written as A += 1;B= B * 5; can be written as A *= 5;Increment & Decrement OperatorsIncrement anddecrement operators are used to add 1 or subtract 1 from the value of thevariable respectively.For instance:A = A +1; or A += 1; or A++; or ++A;A = A -1;or A -= 1; or or A--; or --A;Increment and decrement operators can be used intwo ways:Prefix formPostfix formIn prefix form the operator precedes thevariable; and as a postfix, meaning that the operator follow the variable.Example1:int A,B;A = 5;B = A++; /* B becomes 5 and A becomes 6 */Example2:intA,B;A = 5;B = ++A; /* B becomes 6 and A becomes 6 */.6Relational OperatorsRelational operators are the special type of operators used for comparing twovalues.Relational operators are used with loops and decisions. These Constructsrequire the program to ask questions aboutthe relationship between operands.Relational Operator Meanings< Less than> Greater than<= Less than or equal to>=Greater than or equal to== Equal to!= Not equal toExample:#include <iostream.h>#include <conio.h>void main(void){int a,b;a = 5;b = 7;clrscr();cout << "A == B "<< (a == b);cout << "nA > B " << (a > b);cout << "nA != B " << (a != b);getch();}Concept Of ManipulatorsProgram1# include <conio.h># include<iostream.h>void main(void){int a =175;clrscr();cout << "Value of A Is" << a <<"Only";getch();}Program2# include <conio.h># include <iostream.h># include<iomanip.h>void main(void){int a =175;clrscr();cout << "Value Of A is"<< setw(5)<< a<< "Only"; // Output: Value of A is 175Onlyˆgetch();}setw() Manipulator.Manipulators are the operators used with insertion operator << for controlling(modifying) theoutput generated by the C++ program. setw() is a manipulator thatspecifies that the next value be printed in aspecified width, and the value willbe right justified in the field by default..7Program3# include <conio.h>#include <iostream.h># include <iomanip.h>void main(void){int a =175;clrscr();cout << "Value Of A is"<< setfill(#)<< setw(5) << a<< "Only";getch();}setfill() Manipulator. setfill() manipulator takes a single character as anargument and causes this character to besubstituted for spaces in the empty partof the field.Program4# include <conio.h># include <iostream.h># include<iomanip.h>void main(void){int a =175;clrscr();cout << "Value Of A is"<<setiosflags(ios::left)<< setw(5) << a<< "Only";getch();}setiosflags()Manipulator. It is a manipulator by which we can justify text output the output.Type CastingProgram# include <conio.h># include <iostream.h># include<iomanip.h>void main(void){float num;int intpart;clrscr();cout << "Enter FloatNumber : " ;cin >> num;intpart = (int) num;cout << "Integer Part is : " <<intpart;cout << "nFractional Part is : " << setprecision(5)<< (num - intpart);getch();}.8Control Structure Any well-structured program is consist of threestructures:ˆ Sequence Structure.ˆ Selection/Conditional Structure.ˆ RepetitionStructure.Sequence Structure It is the simplest structure in which thestatements are executed in the order in which they areexecuted.Conditional/Selection Structure Selection of one or multiple statements out ofseveral statements depending uponsome criteria is called selection structure. InC++ language there are different types of conditional structures:1. ifstructure.2. if else structure.3. switch structure.4. conditional operator.ifstatement This is single selection structure used for selecting the single ormultiple statements if the definedcondition is hold, otherwise the statement(s)is skipped, and the control is transfer to the next statement(s) of theprogram.Syntax of an if statement is:if( condition )statementExample: Check the eitheryear is leap, if so display message ˆLEAP YEAR ˆ, otherwise doesnˆt display anymessage.# include <conio.h># include <iostream.h>void main(void){int year;clrscr();cout << ˆEnter Yearˆ;cin >> yearif (num % 2 == 0 )cout << ˆLEAP YEARˆ;}Program: Write a program that read the data in five variables, and find thelargest value.# include <iostream.h># include <conio.h>void main(void){intn1,n2,n3,n4,n5,large;clrscr();cout << "Enter First Number : "; cin >> n1;cout <<"Enter Second Number : "; cin >> n2;cout << "Enter Third Number : "; cin >> n3;cout << "Enter Forth Number : "; cin >> n4;cout << "Enter Fifth Number : "; cin>> n5;large = n1;if (n2 > large) large = n2;if (n3 > large) large = n3;if (n4 >large) large = n4;if (n5 > large) large = n5;cout << "Largest Value is " <<large;getch();.9}Program Read one numeric value (of 4 digits), and check eitherthe number is palindrome or not.# include <iostream.h># include <conio.h>voidmain(void){int num,temp;int d4,d3,d2,d1;clrscr();cout << "Enter 4 Digit ";cin >>
  13. 13. num;temp = num;d4 = num % 10;num = (num-d4) / 10;d3 = num % 10;num = (num -d3) / 10;d2 = num % 10;num = (num - d2) / 10;d1 = num ;num = temp;temp = d4 *1000 + d3 * 100 + d2 * 10 + d1;if (num == temp)cout << "Number is Palindrome";elsecout << "Number is Not Palindrome";getch();}Nested if Statement If thesingle selection structure ˆif statementˆ is written inside anther singleselection structurethen it is called nested single selection structure or nestedif structure. The internal if structure is totally dependedupon external loop.For instance:if (condition){if (condition){}}Program# include <iostream.h>#include <conio.h>void main(void){int num;clrscr();cout << "Enter Number ";cin >>num;if (num >= 100){if (num <= 200){cout << "Number Lies Between 100 to 200";}}getch();}.10Example: Check either the input character is capital alphabet (usingnested if)# include <conio.h># include <iostream.h>void main(void){char ch;clrscr();cout << "Enter any character : ";ch = getch();if (ch >= 65 )if (ch <=90)cout << "nCapital Alphabet is pressed!";}isalpha() It is used to check anASCII character is alphabet or not.if ( isalpha(ch) ) cout << ˆInput Symbol isAlphabet!ˆ;isdigit() It is used to check an ASCII character is digit or not.isalnum() It is used to check an ASCII character is alphanumeric or not.isupper() It is used to check an ASCII character is upper case or not.islower()It is used to check an ASCII character is lower case or not.isspace() It is usedto check an ASCII character is punctuation or not.Necessary information for allabove macroˆs is included in ˆctype.hˆExample: Check either the input symbol isalphabet or not (using isalpha() )# include <iostream.h># include <conio.h>#include <ctype.h>void main(void){char ch;clrscr();cout << ˆEnter Character ˆ;ch= getch();if ( isalpha(ch) )cout << ˆnInput Character is Alphabet ˆ;}if elsestatementIt is a double selection structure, used for executing the statement(s)if the defined condition is satisfied, otherwiseanother block of statement(s)will be executed.Syntax:if (condition)statementelsestatementorif (condition){statement}else{statement}.11Example: Basic pay and grade is input from thekeyboard, write a program that calculate the net pay, afteradding bonus to thebasic pay. If the grade of employer is seventeen or above then the bonus is 500otherwise the bonus is 300.void main(void){float bpay,npay,bonus;int grade;clrscr();cout << "Enter Bpay ";cin >> bpay;cout << ˆEnter Ur Grade ˆ;cin >>grade;if (grade >= 17)bonus = 500;elsebonus = 300;npay = bpay + bonus;printf("nCalculated Pay is %f ", npay);getch(); }else if statementThisstatement is used when the program has several blocks of statement(s) and wewant to execute one blockdepending upon some condition. If the first conditionis true then the statements following the first block will beexecuted, otherwisethe second block will be checked and if it is satisfied then the statementsfollowing it will beexecuted otherwise the next condition will be checked in thesame way and some on.Syntax:if (condition){statement}else if (condition){statement}else{statement}Program Read one numeric value representing the speedof a vehicle, and display the message, depending upon thespeed of the vehicle.#include <iostream.h># include <conio.h>void main(void){int speed;clrscr();cout<< "Enter Speed : ";cin >> speed;if (speed > 200 )cout << "Too Fast!";else if(speed > 150)cout << "Quit Fast!";else if (speed > 100)cout << "Fast";else if(speed > 50)cout << "Normal";elsecout << "Slow";getch(); }.12Example: read thedata in two integer variables and one character variable, and perform thearithmetic operation oninteger values, depending upon the value of charactervariable.# include <iostream.h># include <conio.h>void main(void){int n1,n2;charch;clrscr();cout << "Enter First Number : ";cin >> n1;cout << "Enter FirstNumber : ";cin >> n2;cout << "Enter Operator : ";ch = getche();cout << endl;if(ch == +)cout << "Result is %d " << (n1 + n2);else if (ch == -)cout <<"Result is %d " << (n1 - n2);else if (ch == *)cout << "Result is %d " << (n1 *n2);else if (ch == /)cout << "Result is %d " << (n1 / n2);elsecout << "InvalidValue ";getch();}LOGICAL OPERATORLogical operators are the special type ofoperator use to condense and clarify the complicated selection structures aswellas other constructions.Three main logical operators are:1 AND &&2 OR ||3 NOT !AND It is a logical operator that based on the multiplication. It takes twoconditions and return true if both theconditions are true, if any of thecondition is false, then it return false.OR It is a logical operator that basedon addition. It takes two conditions, and return true if any of the condition istrue, ifboth the conditions are false then it return false.NOT It is a logical that baseon the complement. It takes one expression, and negate (reverse) its value.
  14. 14. Example:NOT TRUE = FALSENOT FALSE = TRUE.13Example: Using OR operators# include<iostream.h># include <conio.h>void main(void){int n1,n2;char ch;clrscr();cout<< "Enter First Number : ";cin >> n1cout << "Enter First Number : ";cin >> n2;cout << "Enter Operator + - * / : ";ch = getche();cout << endl;if (ch == +)cout << "Result is %d " << (n1 + n2);else if (ch == - || ch == ˆ_ˆ )cout <<"Result is %d " << (n1 - n2);else if (ch == * || ch == ˆxˆ || ch == ˆXˆ)cout<< "Result is %d " << (n1 * n2);else if (ch == / || ch == ˆˆ )cout <<"Result is %d " << (n1 / n2);elsecout << "Invalid Value ";getch();}Example:Using AND operatorsvoid main(void){char ch;clrscr();printf("Enter Character :");ch = getche();printf("n");if (ch >= 48 && ch <= 57)printf("Digit ispresses!");else if (ch >= 65 && ch <= 90)printf("Capital alphabet is pressed");else if (ch >= 97 && ch <= 122)printf("Small alphabet is pressed");elseprintf("Any other character is pressed!");getch();}Example: Using NOT operators,check either the input number is 1 or not# include <iostream.h># include<conio.h>void main(void){int num;clrscr();cout << "Enter Number : ";cin >> num;if (!(num == 1))cout << "Input Number is other than 1 ";elsecout << "InputNumber is 1";getch(); }.14Switch StatementSwitch is a multiple selectionstructure and it is similar to the else-if construct but has more flexibilityand a clearerformat.It is well structured, but can only be used in certain caseswhere; Only one variable is tested; all branches must dependon the value of thatvariable. The variable must be an integral type. (int, long, short or char).#include <iostream.h># include <conio.h>void main(void){int num;clrscr();cout <<"Enter Number : ";cin >> num;switch(num){case 1:cout << "One is pressed!";break;case 2:cout << "Two is pressed!";break;case 3:cout << "Three is pressed!";break;case 4:cout << "Four is pressed!";case 5:cout << "Five is pressed!";break;default:printf("Any Other value is pressed!");}getch();}CONDITIONAL OPERATORItis the short form of if-else construct. The conditional operator is also sometimes called the ternary operator sincethey take three arguments.Syntax:expression1 ? expression2 : expression3if the expression 1 is true (that is ifits value is non zero), then the value returned will be expression2 otherwisethevalue return will be expression3Example: Find largest value# include<iostream.h># include <conio.h>void main(void){int num1, num2, large;clrscr();cout << "Enter Number1 : ";cin >> num1;cout << "Enter Number2 : ";cin >> num2large = (num1 > num2) ? num1 : num2;cout << "Largest Value is " << large;getch();}.15Example: Find the absolute value of an integer variable.# include<iostream.h># include <conio.h>void main(void){int num, abs;clrscr();cout <<"Enter Number : ";cin >> num;abs = (num < 0) ? num * -1 : num;cout << "Absoluteof ˆ << num << ˆ is ˆ << abs;getch();}LOOP The default order of execution in aC++ program is top-down. Execution starts at the beginning of the main()functionand progresses, statement by statement, until the end of main() isreached. However, this order is rarely encounteredin real C++ programs. The C++language includes a variety of program control constructs that let you controltheorder of program execution, one of which is a loop structure.Loop is one ofthe most important control structure uses for executing the statement(s) severalnumbers of times.Loop is also called Iteration Structure.C++ gives you a choiceof three types of loopˆ for loopˆ while loopˆ do whilefor loop The for loop isfrequently used, usually where the loop will be traversed a fixed number oftimes. A forstatement has the following structure:for ( initial; condition;increment )statement;initial, condition, and increment are all C++ expressions,and statement is a single or compound C++ statement. Whena for statement isencountered during program execution, the following events occur:1. Theexpression initial is evaluated. Initial is usually an assignment statement thatsets a variable to aparticular value.2. The expression condition is evaluated.Condition is typically a relational expression.3. If condition evaluates tofalse (that is, as zero), the for statement terminates, and execution passes tothe firststatement following statement.4. If condition evaluates to true (thatis, as nonzero), the C++ statement(s) in statement are executed.5. Theexpression increment is evaluated, and execution returns to step 2.Example: Readthe integer number and find its factorial.# include <iostream.h># include<conio.h>void main(void){int a, num, fact;clrscr();cout << "Enter Number : ";cin>> num;fact = 1;for(a=1;a<=num;a++)fact = fact * a;cout << "Factorial of " <<num << ˆ is ˆ << fact; getch();}.16Example: Check either the input number isprime or not.# include <iostream.h># include <conio.h>void main(void){int a,num, div;clrscr();cout << "Enter Number : ";cin >> num;div = 0;for(a=1;a<=num;a+
  15. 15. +){if (num % a == 0)div = div + 1;}if (div <= 2)cout << ˆPrime number" << num;elsecout << ˆNot a prime number" << num;getch();}break statementsWe often comeacross situations where we want to jump out of a loop instantly, without to getback to the conditionaltest. The keyword break allows us to do this. When thekeyword break is encountered inside any C++ loop, controlautomatically passes tothe first statement after the loop. A break is usually associated with an ifstatement.Example: A program that the series of number 1 2 3 4 5# include<iostream.h># include <conio.h>void main(void){int a;clrscr();for(a=1;a<=10;a++){cout << endl << a;if (a == 5) break;}}continue statementIn some programmingsituations we want to take the control the beginning of the loop, bypassing thestatementsinside the loop, which have not yet been executed. The keywordcontinue is encountered inside any C++ loop,control automatically passes to thebeginning of the loop. A continue is usually associated with an if statement.Example: A program that the series of number 1 2 3 4 5 7 8 9 10# include<iostream.h># include <conio.h>void main(void){int a;clrscr();for(a=1; a <= 10;a++){if ( a = = 6 )continue;cout << a;}}.17Nested For Loop When the for loop iswritten inside another for loop, then it is called nested for loop.Example: Aprogram that display the series of numbers1 2 3 4 5 6 7 8 9 102 4 6 8 10 12 1416 18 203 6 ˆ 304 8 12ˆ 405 10 15ˆ 50# include <iostream.h># include <conio.h>#include <iomanip.h>void main(void){int a, b;clrscr();for(a=1; a <= 5; a++){for(b=1;b<=10;b++)cout << setw(5) << a*b;cout << endl;}getch();}Example: Displaythe stars in diamond shape.# include <iostream.h># include <conio.h>voidmain(void){int a, b;clrscr();for(a=1; a <= 20; a+= 2){gotoxy(40-a/2,2+a);for(b=1;b<=a;b++)cout << "*";}getch();}while loop The while statement, It isalso called an unexpected condition loop used to executes a block of statementsas long as a specified condition is true. The while statement has the followingform:Syntax:While (condition) statementCondition is any C++ expression, andstatement is a single or compound C++ statement. When program executionreaches awhile statement, the following events occur:1. The expression condition isevaluated.2. If condition evaluates to false (that is, zero), the whilestatement terminates, and execution passes to the firststatement followingstatement.3. If condition evaluates to true (that is, nonzero), the C++statement(s) in statement are executed.4. Execution returns to step 1..18ExampleA program that read the characters from the keyboard and display it in thecapital, and count how manyvowels characters are pressed.# include <iostream.h>#include <conio.h># include <stdio.h># include <ctype.h>void main(void){char ch;int total = 0;int vowels = 0;clrscr();cout << "Enter Text " << endl;while ((ch =getch()) != r){ch = toupper(ch);printf("%c", ch );if ( ch == A || ch == E|| ch == I || ch == O || ch == U)vowels++;total++;}cout << endl<< "TotalCharacter(s) " << total << endl<< "Vowels " << vowels;getch();}Do while loop Thelast of the three loop in C++ is the do-while loop. This loop is very similar tothe while loop- thedifference is the place where the condition is tested. Thewhile tests the condition before executing any of thestatements within the whileloop. Whereas do-while tests the condition after having executed the statementswithin aloop.This means that do-while would execute its execution at least once,even if the condition fails for the first time itself.The while, on the otherhand will not execute its execution if the conditions fails for the first time.Syntax:do{}while (condition);Example: Display the numbers 1 2 3 4 ˆ 10voidmain(void){int a;a = 1;clrscr();do{printf("%dn",a);a++;}while (a <= 10);getch();}.19Example Convert the decimal number into binary/octal/hexa numbers#include <iostream.h># include <conio.h># include <stdio.h># include <ctype.h>#include <iomanip.h>void main(void){int num=0; // Store Input Valuesint a; //Counter Variableint base = 1; // Control the baseint temp; // Store the valuetemporarilyint pos; // Control the position of binary outputchar ch; // Storethe input digitclrscr();gotoxy(20,3);cout << "Enter 4 Digits Number ";for(a=1 ;a<=4 ; ){ch = getch(); // Take the input invisiblyif (!(isdigit(ch)) ) // Loop if input is not digitcontinue;gotoxy(50+a,3);printf("%c", ch); // display inputdigitch = ch - 48; // convert digit into pure digitnum = num * base + ch; // Addinput digit with previous digitsbase = 10; // Set the base by 10temp = num;gotoxy(4,5+a*2);printf("Decimal : %6d ",temp);printf(" Hexa : %6X ",temp);printf(" Octal : %6o ",temp);printf(" Binary : ");pos = 75;do{int rem;rem = temp % 2 ;// display binary digitgotoxy(pos--,5+a * 2);printf("%1d", rem);temp =(temp-rem) / 2;}while (temp != 0);a++; // Add one in counter variable} // end ofthe for loopgetch();}.20Function A function is a named, independent section of
  16. 16. C++ code that performs a specific task and optionally returnsa value to thecalling program. Functions are easy to use; they allow complicated programs todivide into smallblocks, each of which is easier to write, read, and maintain.Functions are normally classified into two categories. Built in Functions..Programmer Defined FunctionsBuilt in functions are those functions that arealready developed and available with the C++ compiler, standard headerfilesstore necessary information about these functions.Programmer defined functionsare those function that are developed by the programmer itself. Function canacceptargument(s), as well as it can return one value to the calling program. Asfar as the arguments and return value areconcerned we classify function in fourcategories:. Simple function (No Argument, No Return).. Return Value function..Argument function.. Return & Argument function.There are three elements involvedin using functions:. Function Prototype/ Declaration.. Function Definition..Function CallFunction Prototype Function prototype is a single statement comesbefore the main() function. Function prototypeprovides the following informationto the compiler. Function prototype always terminates with semicolon.. Name ofthe function.. List and arrangement of argument(s) accepts by the functions.Function can zero, one or morearguments..Specify either the function can returnany value to the calling program, function can return zero(no value) or onevalue to the program.For Instance:void func1(void);Above line indicates that wehave declared a function ˆfunc1ˆ, that accept no value from the calling program;as wellit will return no value to the calling program.void func2(int, float);Above statement indicates that we have declare a function ˆfunc1ˆ, that accepttwo values from the calling program,in which the first value is of type integerand the second is of type float. Whereas it will returns no value to a callingprogramfloat func3(int, float);Above statement indicates that we have declare afunction ˆfunc1ˆ, that accept two values from the calling program,in which thefirst value is of type integer and the second is of type float. Whereas it willreturns one value of type float.Function Definition It is the actual block ofcode that contains all statements, that will be execute, when the functioniscall. Function definition comes at the end of main() function. Functiondefinition is similar to the definition of themain() function.For instance:voidfunc1(void){ˆ}Function Call It is statement that invokes the function. When thefunction is invoked; it executes all the statementswritten inside the definitionof that function..21Simple Function A function that do not accept any value aswell as do not return any value.Example: A program that display the line ofstars.# include <iostream.h># include <conio.h>void line(void);void main(void){ clrscr();cout << ˆHello Worldˆ;line();cout << ˆHello Worldˆ;line();}voidline(void){ int a;cout << endl;for(a=1;a<=80;a++)cout << ˆ*ˆ;}Argument FunctionsA function that accept the value(s).Example: A program that displays the line ofany character passed as argument.# include <iostream.h># include <conio.h>voidline(char);void main(void){ clrscr();cout << "Hello World"; line(*);cout <<"University Of Balochistan"; line(+);}void line(char ch){int a;cout << "n";for(a=1;a<=80;a++)cout << ch;}Example: A program that displays the line of anycharacter passed as argument, where the length of the line isalso specified asan argument.# include <iostream.h># include <conio.h>void line(int, char);voidmain(void){clrscr();cout << "Hello World";line(50,*);cout << "University OfBalochistan";line(70,+);}void line(int num, char ch){int a;cout << "n";for(a=1;a<=num;a++)cout << ch;cout << "n";}.22Argument & Return Function Afunction that accept value(s) as well as return one value.Example: A functionthat accepts two arguments and return the largest value.# include <iostream.h>#include <conio.h>int findlarge(int, int);void main(void){int res, a = 27, b =90;clrscr();res = findlarge(a,b);cout << "nLargest Value is " << res;}intfindlarge(int num1,int num2){int temp;if (num1 > num2)temp = num1;elsetemp =num2;return temp;}Passing Arguments To FunctionsAn argument is a piece of datapassed from a program to the function. Arguments allow a function to operatewithdifferent values. In C++ the arguments can be passed to function in twoways:ˆ Pass by value.ˆ Pass by reference.Pass By Value When the argument is passby value, a copy of the argumentˆs value is made and passed to the calledfunction. Changes to the copy do not affect the original variables in thecaller. This prevents the accidental sideeffects. Example:# include <conio.h>#include <iostream.h>void change(int, int);void main(void){int a,b;a = 5;b = 7;clrscr();cout << "A : " << a << " B : " << b;change(a,b);cout << "nA : " << a<< " B : " << b;getch();}void change(int a, int b){a = 15;b = 17;}Pass By
  17. 17. Reference A reference provides an alias (different name) for a variable. Whenthe arguments are passed byreference, instead of a values being passed to thefunction, a reference to the original is passed, with this feature thecallergives the called function to the ability to directly access the callerˆs data,and to modify that data if the calledfunction so chooses. To indicate that afunction parameter is passed by reference, simply follow the parameterˆs typeinthe function prototype by an ampersand (&) and use the same convention whenlisting the parameters type in thefunction header..23Example: # include<conio.h># include <iostream.h>void change(int&, int&);void main(void){ int a,b;a = 5;b = 7;clrscr();cout << "A : " << a << " B : " << b;change(a,b);cout <<"nA : " << a << " B : " << b;getch(); }void change(int& a, int& b){ a = 15;b =17;}Default Argument FunctionsIn C++ a function can be called without specifyingall its arguments. For that purpose function definition mustprovide defaultvalues for those arguments that are not specified. If one argument is missingwhen the function iscalled, it is assumed to be last argument. In case ofmultiple arguments they must be the trailing arguments.Example:# include<conio.h># include <iostream.h>void display(int=10 , int =20, int=30 );voidmain(void){clrscr();display(60,70,80); // show 60 70 80display(100,200); // show100 200 30display(300); // show 300 20 30display(); // show 10 20 30getch();}void display(int a, int b, int c){ cout << endl << "A : " << a << " B : " << b<< " C : " << c;}Inline FunctionImplementing a program as a set of functions isgood from a software-engineering standpoint, but function callinvolve executiontime overhead. C++ provides inline functions to help reduce function calloverhead (specially forsmall functions). The qualifier inline before a functionreturns type in the function definition advices the compiler togenerate a copyof the functions code in place (when appropriate) to avoid a function call. Thetradeoff is thatmultiple copies of the function code are inserted in the programrather than having a single copy of the function towhich control is passed eachtime the function is called. The compiler can ignore the inline qualifier andtypicallydoes so for all but the smallest functions.Example: # include <conio.h># include <iostream.h>inline int cube(int n){ return n * n * n;}void main(void){int num,res;clrscr();cout << "Enter Number : " ;cin >> num;res = cube(num);cout<< "Result is : " << res;getch(); }.24Overloaded FunctionsC++ enables severalfunctions of the same name to be defined as long as these functions havedifferent sets ofparameters. This capability is called function overloading.When an overloaded function is called, the C++ compilerselects the properfunction by examining the number, types and order of the arguments in the call.Functionoverloading is commonly used to create several functions of the samename that perform similar tasks, but ondifferent data types. Overload functionsare distinguished by their signatures (a signature is a combination of afunctionname and its parameter types). The function encodes each function identifierwith the number and the typesof its parameter (sometimes referred to as namemangling or name decoration) to enable type-safety linkage. Typesafe linkageensures that the proper overload function is called.Example:# include <conio.h>#include <iostream.h>void line(void);void line(char);void line(char, int);voidmain(void){clrscr();line();line(+);line(#,70);getch();}void line(void){inta;cout << endl;for(a=1;a<=80;a++)cout << "*";}void line(char ch){int a;cout <<endl;for(a=1;a<=80;a++)cout << ch;}void line(char ch, int num){int a;cout <<endl;for(a=1;a<=num;a++)cout << ch;}Variables and Storage ClassesThe storageclass of a variable determines which parts of the program can access it and howlong it stays in existence.As far as storage classes are concerned, thevariables are classified in three main categories:ˆ Automatic variables.ˆ Externalvariables.ˆ Static variables..25Automatic Variables. Variables defined within afunction body are called automatic variables or local variables. Akeyword autocan be used to specify an automatic variable.void main(void){auto int age;autofloat fee;}The word auto is rarely used since this is the default.Lifetime Anautomatic variable is no created until the function in which it is defined iscalled. When the control istransferred to the function, then all its containingvariables are created and memory space is set aside for them, laterwhen thecalled function is terminated the control is return back to the calling program,the variables are destroyedand their values are lost.The time period between thecreation and destruction of a variable is called its lifetime (duration). Thelifetime if anautomatic variable coincides with the time when the function in
  18. 18. which it is defined is executing. The idea behindlimiting lifetime of variablesis to save memory space. If a function is not executing, the variables it usesduringexecution are presumably not needed. Removing them free up memory that canbe used by other functions.Visibility A variables visibility describes thelocations within a program from which it can be accessed. It can bereferred toin statements in some parts of the program, but in others attempts to access itlead to an unknown variableerror message. The word scope is also used todescribe visibility. The scope of a variable is that part of the programwherethe variable is visible. Automatic variables are only visible within thefunction in which they are defined.# include <iostream.h># include <conio.h>voidfun1(void);void main(void){int b = 5;fun1();}void fun1(void){int a = 7;cout <<ˆA : ˆ << a;cout << endl << ˆB : ˆ << b;}Initialization When an automaticvariable is created, the compiler does not try to initialize it. Thus it willstart off withan arbitrary value, which may be 0 but probably will be somethingelse. If we want it initialized, you must do itexplicitly.int a = 45;Example:#include <iostream.h>void main(void){int a;cout << ˆA : ˆ << a; // Any garbagevalue}.26External Variables. External variable is a major storage and definedoutside any function. An external function isvisible to all the functions in aprogram. External variables are also called global variables, since they areknown byall the functions in a program.If external variable is not initializedexplicitly then it is initialized automatically to 0 when it is created. Theexternalexist for the life of the program and visible int the file in which theyare defined, starting at the point where they aredefined.Example: # include<iostream.h># include <conio.h>int data;void fun1(void);void fun2(void);voidfun3(void);void fun4(void);void main(void){clrscr();fun1(); // display 0fun2(); // display 4fun3(); // display 20fun4(); // display 5cout << endl <<"Data is " << data; // display 5getch();}void fun1(void){cout << endl << "Datais " << data;data++;}void fun2(void){data += 3;cout << endl << "Data is " <<data;data++;}void fun3(void){int data=20;cout << endl << "Data is " << data;data++;}void fun4(void){int data=20;cout << endl << "Data is " << ::data;data++;}.27Static Variables. A static variable has the visibility of a local variable;its lifetime is similar to that of an externalvariable, except that it does notcome into existence until the first call to the function containing it.Thereafter itremains in existence for the life of the program. The staticvariable is initialized only once-the first time their functionis called. Theyare not called on subsequent calls to the function as ordinary automaticvariables are.Example: Normal variables initialization.# include <iostream.h>#include <conio.h>void fun(int);void main(void){clrscr();fun(5); // display 5fun(7); // display 7getch();void fun(int a){int res=0;res = res + a;cout << endl<< "Result is : " << res;}Example:# include <iostream.h># include <conio.h>intdata;void fun(int);void main(void){clrscr();fun(5); // display 5fun(7); //display 12getch();}void fun(int a){static int res=0;res = res + a;cout << endl<< "Result is : " << res;}.28Object Oriented Programming (Object and Class )OOPis relatively a new programming technique, in which the program is developed inthe form of an object.ˆ Any real word entity is called an object.ˆ Anythinghaving some properties (attributes) and functions (purposes) is called anobject. By such definition wecan say that every thing in this universe is anobject.For Example: Cup is an object.Cup has several properties:1. Color.2.Cost.3. Width.4. Height.5. Weight6. Material from which it is developed(Plastic, Marble).7. Design.8. Company.Cup has a several functions:1. Use fordrinking tea.2. Use for drinking coffee.3. Use for drinking cold drinks.4. Usefor shave.5. Use for washing car.6. Use as a decoration piece.ˆ Object is anencapsulation of data and other related routines. Placing data and functionstogether into a singleentity is the central idea of object-oriented programming.Objects are defined using a special structure called theclass. A class is atemplate used to define the structure of an object. A class is a user defineddata type. Conceptof object-oriented programming was introduced to implement theinformation hiding. An object has the samerelationship to a class that avariable has to a data type. An object is said to be an instance of a class.Specifying & Using ClassProgram# include <iostream.h># include <conio.h>classstudent{private: int rno;int age;float fee;public:void assign_values(int mrno,int mage, float mfee){rno = mrno;age = mage;fee = mfee;}void get_input(void){cout << endl << "Enter RNo : ";cin >> rno;cout << "Enter Age : ";cin >> age;cout<< "Enter Fee : ";cin >> fee;}void display(void){cout << endl<< "Rno : " << rno
  19. 19. << "Age : " << age<< "Fee : " << fee;}.29};void main(void){student s1,s2,s3;s1.assign_values(10,20,70.0);s2.get_input();s3.get_input();s1.display();s2.display();s3.display();getch(); }Members of Class (Data & Functions)The classdeclaration starts with the keyword class, followed by the class name. The bodyof the class is delimited bybraces and terminated by semicolon. The class hastwo members:ˆ Data Member(s).ˆ Member Functions.The data items within a classare called data members (or sometimes called member data). There can be anynumberof data members in a class. Functions that are included within a class arecalled Member Functions. Some languagessuch as Smalltalk the member functionsare called methods. Some languages refer to calls to member functions asmessages.private and publicA key feature of object-oriented programming is datahiding. Private data and functions can only be accessed fromwithin a class.Pubic data or functions on the other hand are accessible from outside the class.Accessing Members of ClassMembers of a class are accessed using the memberaccess operators (the dot operator) and the arrow operator (->).The dot operatoraccesses a class member via the variable name for the object or via a referenceto the object. Thearrow operator consisting of a minus sign (-) and greater thansign (>) with no intervening spaces- accesses a classmember via a pointer to theobject.Member Functions Outside The ClassIn C++ it is allowed to define theMember function of the class outside its definition.Program# include<iostream.h># include <conio.h>class employee{private: int empid;int grade;intpay;public:void assign (int mempid, int mgrade, int mpay);void display(void);};void employee::assign(int mempid, int mgrade, int mpay){ empid = mempid;grade =mgrade;pay = mpay;}void employee::display(void){ cout << endl << "Employee ID :" << empid<< endl << "Grade : " << grade<< endl << "Pay " << pay; }voidmain(void){ employee e1, e2;clrscr();e1.assign(10,17,10000);e2.assign(20,18,15000);e1.display();e2.display();getch(); }.30Constructors Whena class object its members can be initialized automatically without a separatecall to a memberfunction. Automatic initialization is carried out using aspecial member function called a constructor. A constructor isa class memberfunction with the same name as the class that is executed automatically wheneveran object is created.Constructors cannot return any value.Example:# include<iostream.h># include <conio.h>void main(void){class customer{private:int cno;public:customer() // customer(): cno(0) { }{cno = 0;}void show(){cout << endl <<"Counter Is " << cno;}};customer c1;clrscr();c1.show();getch();}OverloadedConstructors In C++ it is possible to overload the constructor to provide avariety of means forinitializing objects.Example: # include <iostream.h>#include <conio.h>void main(void){class customer{private:int cno;public:customer(){cno = 0;}customer(int temp){cno = temp;}void show(){ cout << endl <<"Counter Is " << cno;}};customer c1;customer c2(21);clrscr();c1.show();c2.show();getch(); }.31Objects As Arguments Objects can be passed to thefunctions as the arguments.Example:# include <iostream.h>include <conio.h>voidmain(void){class income{private:int amount;public:income(){amount = 0;}income(int a){amount = a ;}void assign(int a){amount = a;}void show(){cout <<endl << "Amount Is " << amount;}void add(income i1, income i2){amount =i1.amount + i2.amount;}};income d1;income d2(100);income d3;d3.assign(73);incomed4;d4.add(d2,d3);clrscr();d4.show();getch();}.32Default Copy Constructors In C++it is possible to initialize an object with another object of the same type, and wedonˆt need to create aspecial constructor for this; since it is already built into all classes andknown as default copyconstructor.Example:# include <iostream.h># include<conio.h>void main(void){class biodata{private:int recno;int age;float pay;public:biodata(){recno = 0;age = 0;pay = 0.0;}biodata(int r, int a, float p){recno = r;age = a;pay = p;}void display(){cout << endl << "Record No# " << recno<< endl << "Age " << age<< endl << "Pay " << pay<< endl;}};biodatas1(10,25,12000);biodata s2(s1);biodata s3 = s1;clrscr();s1.display();s2.display();s3.display();getch();}.33Destructors A destructor is a specialmember function of class. The name of the destructor for a class is the tilde(~)character followed by the class name. The destructor is the complement of theconstructors. A classˆs destructor iscalled when an object is destroyed. Thedestructor does not actually destroy the object-it performs terminationhousekeeping before the system reclaims the objectˆs memory so that memory maybe reused to new objects.A destructor receives no parameters and returns novalue. A class may have only one destructor- destructoroverloading is not
  20. 20. allowed.Example: # include <iostream.h># include <conio.h>class myclass{private:int rno;public: myclass(void){cout << endl << "Constructor With No Arguments IsCalled";}myclass(int a){rno = a;cout << endl << "Constructor With One ArgumentIs Called"; }~myclass(){cout << endl << "One Object Is Destroying"; } };voidmain(void){ clrscr();Myclass o1;Myclass o2(1);getch(); }Returning Objects FromFunctions In C++ it is possible to define a function that can return a value.Example: # include <iostream.h># include <conio.h>class my class{private intamount;public: myclass(void){amount = 0; }myclass(int a){amount = a; }myclassaddvalues(myclass o1){ myclass temp;temp.amount = amount + o1.amount;returntemp;}void display(void){cout << endl << "Value of Amount is " << amount ;}};void main(void){ clrscr();myclass o1(10);myclass o2(20);myclass o3;o3 =o1.addvalues(o2);o1.display();o2.display();o3.display();getch();}.34Static ClassData Each object contains its own separate data, if a data item in a class isdeclared as static, then onlyone such is created for the entire class, no matterhow many objects there are. A static data item is useful when allobjects of thesame class must share a common item of information.Example: # include<iostream.h># include <conio.h>class myclass{private: static int count;public:myclass(void){count++;}void display(void){cout << endl << "Value of Count is "<< count ;}};int myclass::count=0;void main(void){clrscr();myclass o1;myclasso2;myclass o3;o1.display();o2.display();o3.display();getch();}Example:# include<iostream.h># include <conio.h>class myclass{private: int sno;static int count;public: myclass(void){count++;sno = count;}void display(void){cout << endl <<"Value of SNo is " << sno ;}};int myclass::count=0;void main(void){clrscr();myclass o1;myclass o2;myclass o3;o1.display();o2.display();o3.display();getch();}.35ARRAYSArray is a data structure generally used for storing the large numberof values having same type.i) Array is a set of finite, fixed and homogenouselements.ii) In array the multiple values are stored with single name reference,but a special integer number called theindex/subscript is used for referring theparticular element of an array.iii) In C++ an array indexing starts at position0. The elements of the array occupy adjacent locations in memory.iv) By usingthe array in a program it is necessary to declare it with the proper command.OneDimension Array An array whose each element is referred by a single array isknown as one dimension array.Array Definition Like other variables, the arrayneeds to be defined, so the compiler will know what kind ofarray, and how longan array, we want.Syntax: datatype arrayname[size];Example: int data[10];Herethe int specifies the type of variable, just as it does with simple variables,andthe word data is the name of the array variable.The [10] tells the how manyvariables of type int will be in our array. Each ofseparate variables in thearray is called an ˆelementˆ. The bracket tells the compilerthat we are dealingwith an array.Referring to Individual Elements of the Array Once the array hasbeen established, we need a way to referto its individual elements. This is donewith subscripts, the number in bracket following the array nameSyntax:arrayname[element];Example:Data[5] = 26;Entering Data into the ArrayMethod1#include <iostream.h># include <conio.h>void main(void){ int temp[7];int avg;clrscr();cout << "Enter Temperature for Day 1 " ; cin >> temp[0];cout << "EnterTemperature for Day 2 " ; cin >> temp[1];cout << "Enter Temperature for Day 3" ; cin >> temp[2];cout << "Enter Temperature for Day 4 " ; cin >> temp[3];cout<< "Enter Temperature for Day 5 " ; cin >> temp[4];cout << "Enter Temperaturefor Day 6 " ; cin >> temp[5];cout << "Enter Temperature for Day 7 " ; cin >>temp[6];avg = temp[0] + temp[1] + temp[2] + temp[3] + temp[4] + temp[5] +temp[6];avg = avg / 7;cout << "Average Temperature is " << avg;getch();}Method2# include <iostream.h># include <conio.h>void main(void){int temp[7];int avg;clrscr();for(int a =0;a<=6;a++){ cout << "Enter Temperature for Day 1 " ;cin >>temp[a];}avg = 0;for(a=0;a<=6;a++)avg += temp[a];avg = avg / 7;cout << "AverageTemperature is " << avg;getch();}.36Program Find the largest value from thearray.# include <iostream.h># include <conio.h>void main(void){int data[10];intlarge;clrscr();for(int a =0;a<=9;a++){cout << "Enter Temperature for Day 1 " ;cin >> data[a];}large = data[a];for(a=0;a<=9;a++)if (data[a] > large)large =data[a];cout << "Largest is " << large;getch();}Program Reverse the elements ofthe array# include <iostream.h># include <conio.h>void main(void){int data[10];int a, temp;clrscr();for(a =0;a<=9;a++){cout << "Enter Temperature for Day 1 " ;cin >> data[a];}clrscr();cout << "Before Reverse" << endl ;for(a=0;a<=9;a++)cout<< "Data " << a << " is " << data[a] << endl ;// Interchange the array elementsfor(a=0;a<=4;a++){temp = data[a];data[a] = data[9-a];data[9-a] = temp;}cout <<
  21. 21. endl << "After Reverse" << endl ;for(a=0;a<=9;a++)cout << "Data " << a << " is "<< data[a] << endl;getch();}Initializing Arrays In C++ language it is possibleto assign the values to the elements of an array.Syntax:¾ datatypearrayname[size] = {value1, value2, value3ˆ valuen};For instance:int data[5] ={11,22,33,14,51};int data[5] = {0}; // all the elements are initialized with avalue 0Example:int data[5] = {10,40,30,5,11};.37Program Calculates the frequencyof the numbers (varies from 0 to 9) input from the keyboard# include<iostream.h># include <conio.h># include <iomanip.h>void main(){ int data[20] ={0};int frequency[10] = {0};int a;clrscr();for(a=0;a<=19;a++){cout << "EnterData (0-9) " ;cin >> data[a] ;}for(a=0;a<=19;a++){++frequency[data[a]];}clrscr();cout << endl << endl<< setw(20) << "Data"<< setw(20) << "Frequency"<<endl;for(a=0;a<=9;a++){cout << setw(20) << a<< setw(20) << frequency[a]<<endl; }getch();}Selection Sort Selection sort is one of the easiest way to sortthe data. The basic idea of the selection sort is to findthe smallest element inthe array and move it to the first position, then find the next smallest elementand move it tothe second position, and continue this process until the next tothe last position is filled. When the correct element isin the next to the lastposition, the sort is finished because the last element, which is the only oneleft, must be thelargest element.Program for selection sort# include<iostream.h># include <conio.h>void main(void){ int data[10];int a,b, index,temp;clrscr();for(a =0;a <= 9; a++){cout << "Enter Data " << a << " : ";cin >>data[a]; }for( a = 0 ; a <= 8 ; a++){index = a ;temp = data[a];for( b = a + 1; b<= 9 ; b++){ if ( temp > data[b]){ temp = data[b];index = b;} }data[index] =data[a];data[a] = temp; }clrscr();for(a=0;a<=9;a++)cout << "nData " << a << "is " << data[a];getch();}.38Passing Arrays To Functions To pass an arrayargument to a function; specify the name of the array without anybrackets.#include <iostream.h># include <conio.h>void input(int [], int n );voiddisplay(int [], int n);void main(void){int data[10];input(data,10);display(data,10);getch();}void input(int array[], int size){clrscr();for(int a=0; a<size; a++){cout << "Enter Data " << a << " : " ;cin >> array[a];}}void display(intarray[], int size){clrscr();for(int a=0; a<size; a++)cout << "Data " << a << "is " << array[a] << endl ;}Program Generates the frequency table.# include<iostream.h># include <conio.h># include <iomanip.h>void main(){int data[20] ={0};int frequency[10] = {0};int a;clrscr();for(a=0;a<=19;a++){cout << "EnterData (0-9) " ;cin >> data[a] ;}for(a=0;a<=19;a++){++frequency[data[a]];}clrscr();cout << endl << endl<< setw(20) << "Data"<< setw(20) << "Frequency"<<endl;for(a=0;a<=9;a++){cout << setw(20) << a<< setw(20) << frequency[a]<< endl;}getch();}.39String The way a group of integers can be stored in an integerarray, similarly a group of characters can be stored in acharacter array. In C++language an array of characters is called a string. Programming languages tomanipulate textsuch as words and sentences uses character arrays or strings.String constantcout << ˆHelloˆ;ˆHelloˆ is a string constant. That means thestring itself is stored someplace in memory, but that it cannot bechanged. Each character occupies one byte of memory, andthe last character of the string is the character ˆ0ˆcalled the null character,which indicates the end of the string.String Variable# include <conio.h>#include <iostream.h>void main(void){char name[30];cout << ˆEnter Name : ˆ;cin >>name;cout << endl << ˆInput Name is ˆ << name;getch();}Note: The extractionoperator >> uses any white space character to terminate entry of variable. Sothere is no way toenter a multiword string into a single array using >>Note:C/C++ does not support bound checking features.Avoiding Buffer Overflow In C++there is no built in mechanism to keep a program from inserting array elementsoutside an array, but we can use the >> operator to limit the number ofcharacters it places in an array.# include <conio.h># include <iostream.h>#include <iomanip.h>void main(void){char name[30];cout << ˆEnter Name : ˆ;cin >>setw(30) >> name;cout << endl << ˆInput Name is ˆ << name;getch();}ReadingEmbedded Blanks cin.get() This member function allows to read text containingblanks.Syntax:cin.get(string_variable, MAX);Example:# include <conio.h># include<iostream.h>void main(void){char name[10];clrscr();cout << "Enter Name ";cin.get(name,10);clrscr();cout << endl << "Name is " << name;getch();}.40ReadingMultiple Lines By using the third argument with cin.get() function, we can entera string multiple lines.This argument specifies the character that tells thefunction to stop reading. The default value for this function is thenewline (ˆnˆ) character by the default value can be override by the specified character.
  22. 22. # include <conio.h># include <iostream.h>void main(void){ char text[10];clrscr();cout << "Enter Text ";cin.get(text,10, ˆ#ˆ);clrscr();cout << endl <<"Text is " << text;getch();}String Functionsstrlen() Use strlen to find thelength of the a string in bytes, not counting the terminating null character.Itsassociated header file is string.hExample:# include <conio.h># include<iostream.h># include <string.h>void main(void){ char name[25];int len;clrscr();cout << ˆEnter Name : ˆ;cin.get(name.25);len = strlen(name);cout << ˆnLength ofˆ << name << ˆ is ˆ << len; }strcpy() Use strcpy to copy one string to another.Its associated header file is string.hSyntax:strcpy(string1, string2); /* Copystring2 to string1 */Example:void main(void){ static char s1[10] = ˆHelloˆ;chars2[10];strcpy(s2,s1); }strcmpi() Use strcmpi() to compare strings and return aninteger value.Syntax: strcmpi(string1, string2);The return value is zero if thetwo strings are identical. If string1 is less than sting2, the return value islessthan zero, when string1 is greater than string2; it returns an integer valuegreater than zero, where thecomparison is case sensitive. Its associated headerfile string.hExample: Check whether 2 input strings are equal or not.# include<conio.h># include <iostream.h># include <string.h>void main(void){ chartext1[25];char text2[25];int res;clrscr();cout << "Enter Text1 ";cin.get(text1,25);cout << "Enter Text2 ";cin.get(text2,25);res =strcmpi(text1,text2);if ( res == 0 )cout << ˆStrings R Equalˆ;elsecout <<ˆStrings R Not Equalˆ;getch(); }.41strupr() Use to convert any lowercase lettersin a string to uppercase, other characters in the strings are unaffected.Itsassociated header is string.hSyntax:strupr(string);Example:void main(void){static char text[25] = ˆhello worldˆ;strupr(tex);}strlwr() Use to convert anyuppercase letters in a string to lowercase, other characters in the strings areunaffected.Its associated header file is string.hSyntax:strlwr(string);Example:void main(void){static char text[25] = ˆhello worldˆ;strlwr(text);}strrev() Usestrrev() to reverse the order of the characters in string. The terminating nullcharacter remains at thesame place. strrev() is normally used to check whether astring in palindrome. Its associated header file isstring.hSyntax:strrev(string);Example: Check either the input string is palindrome on not.#include <conio.h># include <iostream.h># include <string.h>void main(void){chartext1[25];char text2[25];clrscr();cout << "Enter Text ";cin.get (text1,25);strcpy(text2,text1);strrev(text2);if ( strcmpi(text1,text2) == 0 )cout <<ˆString Is Palindromeˆ;elsecout << ˆString is Not Palindrome";getch();}strcat()Use strcat to concatenate (append) one string to another. Its associated headerfile is string.hSyntax:strcat(string1, strzing2);Example:void main(void){charfirst[10] = ˆkaraˆ;char second[5] = ˆchiˆ;strcat(first,second); /* concatenatesecond with first */}.42Two Dimension Arrays: Two-dimension array (matrix) is anarray whose each element is itself an array. In two-dimensionarray each elementis referred by two index values, in which one represent the row position and thesecondrepresent column position.Syntax for creating two-dimension arraydatatypearrayname[rows][columns];For instance:int data[3][4];Referring to IndividualElements of the 2D Array Once the array has been established, we need a way torefer toits individual elements. This is done with subscripts, the numbers inbrackets following the array nameSyntax:arrayname[rowposition][columnposition];Example:data[2][3] = 26;Method1: Entering data in 2D Array# include <iostream.h># include <conio.h>void main(void){int data[2][3];cout << "Enter Data "; cin >>data[0][0];cout << "Enter Data "; cin >> data[0][1];cout << "Enter Data "; cin>> data[0][2];cout << "Enter Data "; cin >> data[1][0];cout << "Enter Data ";cin >> data[1][1];cout << "Enter Data "; cin >> data[1][2];}Method2: Enteringdata in 2D Array# include <iostream.h># include <conio.h># include <iomanip.h>void main(void){int data[2][3];int a,b;clrscr();for(a=0;a<=1;a++){for(b=0;b<=2;b++){cout << "Enter Data ";cin >> data[a][b];}}clrscr();for(a=0;a<=1;a++){for(b=0;b<=2;b++)cout << setw(5) << data[a][b];cout << endl ;}getch();}.43Program Calculates the sum of rows and columns of 2-dimension array.# include <iostream.h># include <conio.h># include <iomanip.h>void main(void){int data[5][5];int a,b;int tr, total;int tc;clrscr();for(a=0;a<=4;a++){for(b=0;b<=4;b++){cout << "Enter Data ";cin >> data[a][b];}}clrscr();//displayand addtotal = 0;for(a=0;a<=4;a++){tr = 0;for(b=0;b<=4;b++){cout << setw(5) <<data[a][b];tr = tr + data[a][b];}cout << setw(5) << tr;cout << endl ;total =total + tr;}for(a=0;a<=4;a++){tc = 0;for(b=0;b<=4;b++)tc = tc + data[b][a];cout<< setw(5) << tc;}cout << setw(5) << total ;getch();}.44Arrays As Class MemberData# include <iostream.h># include <conio.h># include <iomanip.h>class
  23. 23. shopping_mall{private:int shops[50];public:void assign(int income,int shop){shops[shop] = income;}void display(int shop){cout << endl << "Income of a Shop "<< shop << " is " << shops[shop] ;}};void main(void){ shopping_mall plaza1;shopping_mall plaza2;int a;clrscr();for( a=0;a<=49;a++)plaza1.assign(-1,a);for( a=0;a<=50;a++)plaza1.assign(-1,a);plaza1.assign(500,25);plaza1.assign(5000,15);plaza2.assign(2000,10);plaza2.display(10);plaza1.display(15);getch();}Array of Objects# include <conio.h># include<iostream.h># include <iomanip.h>class biodata{private: int rno;float fee;public: biodata(void){ rno = 0;fee = 0.0;}void assign(int r, float f){ rno = r;fee = f;}void input(void){ cout << endl << "Enter RNO : "; cin >> rno;cout <<"Enter Fee : "; cin >> fee;}void display(void){cout << endl << "Roll No# " <<setw(5) << rno << " Fee : " << fee;}};.45void main(void){biodata s1[20];int a;s1[0].assign(10,500);clrscr();for(a=1;a<=19;a++){s1[a].input();} clrscr();for(a=0;a<=19;a++)s1[a].display();}Operator Overloading. Operator is a Sequenceof symbols that define a certain operation on the data.Introduction What isOperator Overloadingˆ It is one of a most powerful feature of C++.ˆ Operatoroverloading is the straightforward and natural way to extend the C++.ˆ Normallythe C++ operators can only be used with built in data types; however it ispossible to enable the C++operators to work with user defined data type (classobjects) by a process called an operator overloading.ˆ Operator overloading ismost appropriate for mathematical classes.ˆ Operator overloading is notautomatic, however; the programmer must write operator-overloading functions toperform the desired operations.ˆ Operator overloading function is like thenormal function except that the function name is a keyword followed bythe symbolfor the operator being overload.Advantages ˆOperator overloading contributes toC++ extensibility, one of the languageˆs most appealing attributes.ˆ Correct useof operator overloading makes a program clearer than accomplishing the sameoperations withexplicit function calls.Disadvantage ˆInconsistent use ofoperator overloading make a program cryptic and difficult to read.Limitation ofOperator Overloadingˆ Operator overloading cannot change the precedence of anoperator.ˆ Overloading cannot change the associativity of an operator.ˆ It isnot possible to change the ˆarityˆ of an operator (i.e., the number of operandsan operators takes). Overloadedunary operators remain as unary operators,overloaded binary operators remain as binary operators.ˆ Ternary operator( ? : ) cannot be overloaded.ˆ It is not possible to create new operators: onlyexisting operators can be overload.ˆ Operator overloading works with objects ofuser-defined types or a mixture of an object of a user-defined typeand an objectof a built in type..46Overloading Unary Operators.Program Prefix (But doesnˆtallow assignment i.e., a = ++b)# include <iostream.h># include <conio.h>class myclass{private: int count;public: myclass(void){count =0;}myclass(int c){count = c;}void display(void){cout << endl << "Count is " <<count;}void operator ++ () // Increment Prefix{count++;}};void main(void){ myclass o1;myclass o2(5);clrscr();++o1;o1.display(); // Display 1o2.display();// Display 5++o2;++o2;o2.display(); // Display 7getch(); }Program Prefix (Allowsassignment i.e., a = ++b)# include <iostream.h># include <conio.h>class myclass{private: int count;public: myclass(void){count = 0;}myclass(int c){count = c;}void display(void){cout << endl << "Count is " << count;}myclass operator ++() // Increment Prefix with assignment ability{ count++;myclass temp;temp.count= count;return temp;}};.47void main(void){myclass o1;myclass o2;clrscr();++o1;o2= ++o1;o1.display(); // Display 2o2.display(); // Display 2getch();}ProgramOverloading of unary operator (prefix/postfix) with assignments# include<iostream.h># include <conio.h>class myclass{private: int count;public:myclass(void){count = 0;}myclass(int c){count = c;}void display(void){cout <<endl << "Count is " << count;}myclass operator ++ () // Increment Prefix withassignment ability{count++;myclass temp;temp.count = count;return temp;}myclassoperator ++ (int) // Increment PostFix with assignment ability{myclasstemp(count);count++;return temp;}};void main(void){myclass o1;myclass o2(10);myclass o3;myclass o4;++o1; // 1o3 = ++o1; // o3 = 2, o1 = 2o2++; // 11o4 = o2++; // o4 = 11, o2 = 12clrscr();o1.display(); // Display 2o2.display(); //Display 12o3.display(); // Display 2o4.display(); // Display 11getch();}.48Overloading Binary OperatorsProgram: Overloading + operator# include<iostream.h># include <conio.h>class totalwork{private:int months;int days;public:totalwork(){months = 0;days = 0;}totalwork(int m, int d){months = m;days= d;}totalwork operator + (totalwork t){totalwork temp;temp.months = months +
  24. 24. t.months;temp.days = days + t.days;if (temp.days > 30){temp.months++;temp.days =temp.days - 30;}return temp;}void display(void){cout << endl << endl <<"Months : " << months;cout << endl << "Days : " << days;}};void main(void){totalwork e1(5,10);totalwork e2(3,25);totalwork e3;clrscr();e1.display();e2.display();e3 = e2 + e1;e3.display();getch(); }###############################################################################################################################################################4###È###Î###Ï###Z ##b ##c ##ˆ ##ˆ ##ˆ ##æ ##ê ##ë ##ˆ###¥###
  25. 25. ###
  26. 26. ##ç##÷##û#####¯###Á###W###e###}###ˆ###g###|#######(###+###0###3###6###l###ˆ###L###N###u###¶###¸###Á###Ã###î#######ùèùäèùäèùäèùäèÐè¼è¼è¼è¼è¼è¨ˆùè¼è¼è¼èùèˆùèwèwèÐ#### #h
  27. 27. ?ý##hû###CJ##OJ##QJ##^J##aJ#####h
  28. 28. ?ý##hû###CJ##OJ##QJ##^J### #h
  29. 29. ?ý##hû###CJ #OJ##QJ##^J##aJ###&#h
  30. 30. ?ý##hû###5#ˆCJ #OJ##QJ###ˆ^J##aJ###&#h
  31. 31. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###&#h
  32. 32. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hˆBÜ## #h
  33. 33. ?ý##hû###CJ##OJ##QJ##^J##aJ###
  34. 34. #h
  35. 35. ?ý##hû###.####+###4###[###È###Ï###@ ##Z ##c ##ˆ ##ˆ ##æ ##ë #####V##Â##1###ˆ###
  36. 36. ##|
  37. 37. ##ó
  38. 38. ##T##Ç##5###ˆ###÷###b###ú############õ############ì############ì############ç############ì############ì############ç############ì############ç############ì############ç############ì############ì############ì############ì############ì############ì############ì############ì############ì############ì############ì############ì############ì############ì################################gdˆBÜ###7$#8$#H$#gdû#######gdÓNk#####gdÓNk###b###Ò###>###}###ˆ###Ð#######/###R###g###|###ô#######P###s###ˆ###Î###õ###6###l###ˆ###ˆ###°###Ò###ó###########/###N###ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö##################gd#KJ###7$#8$#H$#gdû#####N###u###¶###)###ˆ###Á###/###ˆ###û###f###s###u###ç######Ó###û###j###ˆ###¥###Õ###í###############>###i###k###p###r###ú############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ú############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############## ##7$#8$#H$#gdû#######gd#KJ#######s###u###w###|###û###ý###ˆ###¥###Õ###########i###k###p###r###·###¹###¾###À##########*###3###4###ˆ###ˆ###########C###E###)###I###d###ˆ###ˆ###ˆ###¤###¥###ç######ïÞïÊïÞïÃïÊï¯ïˆï¯ïˆï¯ïÈÊïÞïÞïÞï¯ï¯ïˆÃˆït############################&#h
  39. 39. ?ý##hû###5#ˆCJ
  40. 40. #OJ##QJ###ˆ^J##aJ#####h
  41. 41. ?ý##hû###CJ##OJ##QJ##^J#####h#KJ##&#h
  42. 42. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###&#h
  43. 43. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ###
  44. 44. #h
  45. 45. ?ý##hû####&#h
  46. 46. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
  47. 47. ?ý##hû###CJ##OJ##QJ##^J##aJ### #h
  48. 48. ?ý##hû###CJ##OJ##QJ##^J##aJ##(r###ˆ###·###¹###¾###À###á##########*###3###ˆ#######ˆ###¥###Ü###########/###`###ˆ###õ#######C###¬#######)###I###d###ö############ö############ö############ö############ö############ö############ö############ö############ñ############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gd#KJ# ##7$#8$#H$#gdû#####d###ˆ###ˆ###¥###ç#### ##0 ##@ ##R ##X ##ˆ ##ˆ ##¥ ##Ô##ä ##ø ##û ###!###!###!##<!##L!##Y!##d!##ˆ!##ˆ!##¡!##Â!##È!##ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gd#KJ# ##7$#8$#H$#gdû#####È!##Ô!##Ü!##è!###"###"##"##1"##="##e"##p"##w"##|"##ˆ"##ˆ"##¨"##À"##Ô"##á"##ü"######ˆ###$##ˆ$##ÿ$###%###%##M%##d%##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##########################7$#8$#H$#gdû########|"##ˆ"##ˆ"##ˆ"##ˆ"##¨"##ª"##À"##Â"##Ô"##Ö"##á"##ã"##ü"######.###3###t###y###O$##T$##÷$##ü$###%###%###%###%###%##&%##÷%##ý%###&###&##&##ïÞÍÞÍÞÍÞÍÞÍÞÍÞ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ«ˆˆÞ}fÞW##h
  49. 49. ?ý##hû###CJ##OJ##QJ##^J###,#h
  50. 50. ?ý##hû###5#ˆ6#ˆCJ##OJ##QJ###ˆ]#ˆ^J##aJ###&#h
  51. 51. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####h1R##hû###0J### #h
  52. 52. ?ý##h1R#CJ##OJ##QJ##^J##aJ#####hû###CJ##OJ##QJ##^J##aJ###&#h
  53. 53. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
  54. 54. ?ý##hû###CJ##OJ##QJ##^J##aJ### #h
  55. 55. ?ý##hû###CJ##OJ##QJ##^J##aJ### #h
  56. 56. ?ý##hû###CJ
  57. 57. #OJ##QJ##^J##aJ##"d%##t%##v%##}%##ˆ%##ˆ%##ˆ%##ˆ%##²%##Â%##Ä%##Ë%##Ò%##ì%###&##&##*&##ˆ&##ˆ&##¥&##³&##È&##õ&##
  58. 58. ####0##2##M##a##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gd
  59. 59. &.# ##7$#8$#H$#gdû#####&##*&##+&##ˆ&##¥&##¶&##·&##2##M##q(##ˆ(##Û(##à(##))##0)##ˆ*##±*##Ï*##Ó*##ˆ+##ˆ+###,## ,##,###,##ˆ,##¤,##¥,##¦,##ˆ-##¸-##ÿ-###.## .###.##X.##Z.##ˆ.##ˆ.##ˆ.##ˆ.##üè×è×É×è×è×è×è×è×è×è׸«×§è׈׈wˆ×h×è×è######h
  60. 60. ?ý##hû###CJ##OJ##QJ##^J#####hö(ˆ#CJ##OJ##QJ##^J##aJ#####hF#~#CJ##OJ##QJ##^J##aJ###&#h
  61. 61. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hu#Î####h
  62. 62. ?ý##hû###OJ##QJ##^J#####h4Rˆ#OJ##QJ##^J###
  63. 63. #h
  64. 64. ?ý##hû######hFEí#CJ##OJ##QJ##^J##aJ### #h
  65. 65. ?ý##hû###CJ##OJ##QJ##^J##aJ###&#h
  66. 66. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ#####h
  67. 67. &.#(a##{##ˆ##¡##Ì##Õ##×##)(##1(##N(##(##q(##å(##))##ˆ)##ÿ)##r*##ˆ*##±*##(+##ˆ+###,###,##!,##6,##L,##j,##ˆ,##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö###################################gd4Rˆ# ##7$#8$#H$#gdû#####ˆ,##¥,##í,##÷,##<-##S-##g-##w-##y-##ˆ-##¸-##Ö-##ä-###.##N.##Z.##¢.##¹.##Í.##Ý.##ß.##í.###/##</##S/##]/##ˆ/##©/##Å/##ú############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############ñ############## ##7$#8$#H$#gdû#######gdu#Î###ˆ.##</##S/##ˆ/##ˆ/##¤/##©/##Ò/##ð/##ñ/##ò/##w2##ˆ2##³4##µ4##Ê4##Ë4##¸5##Õ5###7##)7##]7##m7###8###8##E8##M8##]8##ˆ8##ˆ8##ˆ8##½9##¿9## :###:##ˆ:##ˆ:##_;##u;##¸;##Ï;##õ;###<##T<##a<##ª<##º<##
  68. 68. =##!=##ˆ=##ˆ=##ˆ=## =##±=##²=##³=##·=##ïÛïÛïÛïÒÛÁïºï«º§ïºïºïÛïÛïÛïˆïÛï«ïÛïÛïÛïÛïÛïÛïÛïÛïÛï«ÒÛÁï##########&#h
  69. 69. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####hi8~####h
  70. 70. ?ý##hû###CJ##OJ##QJ##^J###
  71. 71. #h
  72. 72. ?ý##hû#### #hi8~#5#ˆCJ##OJ##QJ###ˆ^J##aJ#####hi8~##hû###0J###&#h
  73. 73. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
  74. 74. ?ý##hû###CJ##OJ##QJ##^J##aJ##8Å/##Î/##Ð/##Ò/##ò/##=0##®0##1##u1##ˆ1##¸1##Þ1##þ1###2##-2##R2##w2##ˆ2###3###3##93##a3##ˆ3##¨3##µ3##)4##34##<4##C4##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gdi8~# ##7$#8$#H$#gdû#####C4##n4##x4##ˆ4##ˆ4##µ4##Ë4##!5##ˆ5##¸5##Õ5##á5##ð5## 6##%6##16##A6##J6##`6##t6##ˆ6##ˆ6##ˆ6##ˆ6##ˆ6##§6##Æ6##å6###7##ö############ö############ö############ö############ö############ñ############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gdi8~# ##7$#8$#H$#gdû######7###7###7##)7##27##F7##]7##m7##o7##{7##ˆ7##-7##¶7##¸7##Á7##Õ7##ì7###8###8###8##8##*8##B8##R8##ˆ8##ˆ8##ˆ8##ý8##m9##ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gdi8~# ##7$#8$#H$#gdû#####m9##¿9##È9##Ü9##ó9## :###:###:##:##1:##I:##Y:##i:##t:##}:##ˆ:##ô:##+;##4;##H;##_;##u;##ˆ;##ˆ;##ˆ;##ˆ;##µ;##Ï;##ß;##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##########################7$#8$#H$#gdû#####ß;##ê;##ó;##õ;##T<##a<##i<##}<##ˆ<##ª<##º<##¼<##Ç<##Ô<##Þ<###=##
  75. 75. =##!=##J=##ˆ=##ˆ=##ˆ=## =##³=##ï=###>##(>##@>##´>##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##########################7$#8$#H$#gdû#####·=##Æ=##ï=##ñ=###>###>##(>##*>##@>##S>##¾>##Ý>##Þ>##ß>##÷?###@###@###@##ø@##û@##A###A###A###A##,A##ÁA##ÓA##1B##3B##¹B##ÉB##wD##yD##úE##&F##ˆF##ˆF##ˆF##ïÞÍÞÍÞÍÞ¹Þ²®¹Þ²®¹ÞˆÞˆÞˆ¹Þ¹Þ¹Þ¹ÞzÞ¹Þq¹#######################################hÎ_,##hû###0J#####h
  76. 76. ?ý##hû###CJ##OJ##QJ##^J###&#h
  77. 77. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ### #h
  78. 78. ?ý##hû###CJ##OJ #QJ #^J #aJ#####hÎ_,##
  79. 79. #h
  80. 80. ?ý##hû####&#h
  81. 81. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ### #h
  82. 82. ?ý##hû###CJ##OJ##QJ##^J##aJ### #h
  83. 83. ?ý##hû###CJ##OJ##QJ##^J##aJ### #h
  84. 84. ?ý##hi8~#CJ##OJ##QJ##^J##aJ##%´>##¾>##Þ>##0?##¢?##³?##É?##Þ?##÷?###@##l@##â@##ë@## A###A###A##ˆA##ˆA##ªA##ÁA##ÑA##ÓA##ÝA##çA##ýA##B###B##1B##3B##ö############ñ############ö############ö############ö############ö############ö############ö############ñ############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##################gdÎ_,# ##7$#8$#H$#gdû#####3B##ˆB##¥B##¹B##ÉB##ËB##åB##ïB###C##HC##tC## C##ÌC##ØC##ôC###D##,D##HD##nD##yD##{D##ÛD##òD###E###E###E##&E##7E##AE##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##########################7$#8$#H$#gdû#####AE##[E##gE##sE##ˆE##ˆE##¦E##½E##ÌE##ãE##îE##úE##&F##7F##WF##F##ˆF##ˆF##ˆF## F###G##ˆG##ˆG##¡G##°G##²G##ÁG##ÃG##ÅG##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö######################## ##7$#8$#H$#gdû#####ˆF## F##ˆG##¡G##úG##H##¡H##¤H##H##ôH###I##/I##½I##ÇI###J##DJ##|J##ˆJ##ÅJ##ÏJ##
  85. 85. K###K##SK##]K##ˆK##êK##.L##ûL##M###N###N##"N##%N###O###O###O###O##0O##4O##ˆO##ÂO###P###P##ÅQ##ÍQ##ÐR##àR##ßS##âS##ëS##ÁT##ÑT##ÓT##ÞT##ˆV##ïÞÇÞ³Þ¤³ˆÞ³Þ³Þ³Þ³Þ³Þ³Þ³ÞLjވޤވ޳޳޳޳ވވ޳ޤÇÞ³Þ³Þ
  86. 86. #h
  87. 87. ?ý##hû####&#h
  88. 88. ?ý##hû###6#ˆCJ##OJ##QJ##]#ˆ^J##aJ#####h
  89. 89. ?ý##hû###CJ##OJ##QJ##^J###&#h
  90. 90. ?ý##hû###5#ˆCJ##OJ##QJ###ˆ^J##aJ###,#h
  91. 91. ?ý##hû###5#ˆ6#ˆCJ##OJ##QJ###ˆ]#ˆ^J##aJ### #h
  92. 92. ?ý##hû###CJ##OJ##QJ##^J##aJ####hÎ_,#5#ˆCJ##OJ##QJ###ˆ^J##aJ##6ÅG##ÇG##ÏG##æG##úG##H##
  93. 93. H###H###H##8H##DH##TH##VH##fH##hH##ˆH##ˆH##ˆH##ˆH##¤H##ôH###I###I##/I##1I##:I##DI##fI##tI##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö######################## ##7$#8$#H$#gdû#####tI##ˆI##ˆI##»I##½I###J##:J##|J##ÅJ##
  94. 94. K##SK##ˆK##ˆK##áK##.L##EL##YL##mL##}L##ˆL##ˆL##ˆL##®L##¼L##ÏL##ùL##ûL##M##ˆM##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ñ############ö##################gdÝvm# ##7$#8$#H$#gdû#####ˆM##¶M##¾M##ÍM##×M##ÜM##æM##éM##øM##úM###N###N###N##N###N###N##ˆN##ëN###O###O###O##0O##;O##EO##O##iO##ˆO##ˆO##£O##ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö############ö##########################7$#8$#H$#gdû#####£O##°O##µO##ÂO##×O###P###P###P##ˆP##ýP##rQ##ÅQ##ÍQ##ÜQ##ÞQ##èQ##êQ##þQ###R##R##

×