0% found this document useful (0 votes)
22 views5 pages

C++ Practical Journal 02

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

C++ Practical Journal 02

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

PRACTICAL -12

to demonshrate
lAim: Pngzam.
we declareaniotegar auable
thic pogran
heoyi a value 'b Wethen
e celetea polnto
Can store the
katiableph uhih
tpe an'in lodeger vatable:.
memy addecs
Code#incdude siastem 2

int

int xs5;

Kendl'
Cout ee " Value ol X"<X
Xi<<RY<endli
-catt<« " Addtess
<endl
Coute " Value q ph- "e< phi e *phKendl
Cat " Value addresc pBr
Coutee" Neut value KI Kedl:
retatno;

lOutput i Value g is
Addtess ti o19 fey
Value pt : ax 76fery
Vaue addrecsph. s. New yalue fKi 10
FOR EDUCATIONAL USE
Sundaram)
PRACTICAL- 013
demas hate tert and Biray Ale handing
hecny hn thic þoq1am we fict cemashrae tect ke handla
lWe cteate foo fr a tect ile op
the fle tor wtitg ond then wte som text to Ale
the "<< " oporator
Cade i nchude <lastieam>
# Íncdude <kteam
# ioclude <ctigz
Ustag natneçpace std
ofshem tecfile
tertfile. op97 (" tect fl ".tet"):

tertAle Hella hiortd ' <endl


textAle < Tat is fle <<endl
textfle.clare O;
Coct e " Tett file created and wwittee suestly
<Kendll'
else

Coute 'Enar. Textfle cadd nt be CHeated ndl

FOR EDUCATIONAL USE


sundaram
ikttean textfle m

IE Ctert fAkn. k oper ()3

shigline
uhile lgehine C textilen Jine))
Caut c< line << ndl

tert Ale n. clase () ;


Coutee " Tect ile read suasily 4"e<eall;
else

Couke " EinDr Text file caudnot be gpened for


teadirg

ofcten binfle.
bioile.open (' Binay-Ale. bia" las ot ia:bltatny 2,

bin fles und Be (lchar kJ( data , sizyl cdaka )l;


binfik. close );
Cout «" Binany File created and niten suceartaly !

Sundaram FOR EDUCATIONAL USE


else

Couts<"Eior Birony file coudd not be created 'endl;

bínfile n.cpeo ("binay hle. bla ia inf as i: blay )


Iot data C51
binfile hn. tead (Cchan )) data azg Cdat)
bio hle h .Chse);

l pint the tead


data
for ( int j:0iLs; ltt)

Coute data [il <e"

Cout <« endl;


else

Coute "Eror : Biay


Biavy File
File Cruld
Cauld natat be opa fhr
teacdng <enl;

Sundaram FOR EDUCATIONAL USE


Sundaram
EDUCATIONAL
USE FOR
23
suesfly4 end Fle BiBinaynany
tehilly! iten and cranted Rle
suceskuly! ed ile Text
file fert Thit
Culd! Hello
uTestly hen ui and ciated AkTect Output

You might also like