C++ Practical File

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

OUT PUT

Hello woId
SHRI BALAJ STATIONERS 094946904

A
M. B. M. UNIVERSITY
ODHP
VERS JODHPUR
Date. .. Experiment No. .* * * * ... P. No.....
Name Roni.Kuma. Saini Faculty No. .. ******* Class... .....Batch..

OBJECTI
To display- a message Helo WOYd
in Tuybo C++

imclude LConioh
Einc lude Liostxeam . h2

Void main )

COut L Hela word":

tch ) .
OUT PUT

T Simgle Lime
Nome Rohil Rols No. 123u,CJass B.E TT «d Sem ocal
Address 13 9ayatvi colom 3 odhPu,Pemonen* Addres ehyoT
Alwa

In multiple Line

Name Rohi
ol No. 123
CJass B.E r d Sem
Local Address 13 3oyatvi
Colony , 3odhpur
Pedmanent A ddress BehroY PAJwar
SHRI BALAJI STATIONERS 8949469034
M. B. M. UNIVERSITY
UNVERS
SITY,JO
JODHPUUR
Date Experiment No. ... 1 . . P. No.....
Name Rehis..KumAx...aini...
Faculty NNo. * *************

....Class. Batch...
OBJECT
******

To dSplay he name
Ko mo ClasS Local
AddxesS Pemanent Add xess
USing Single ine and
Multipleime Output im Iubo C++-

imclude 2 conio-h
nc.lude L Jostxeam_ h2

Void main )

CscxO
Cout TnSingle Line LLend
Cout L \h Name Rohid
Cout RoLA No 123u
Cout LLCJass 8.E I1d
Sem..
COwiL Loca ALdIess : 13 gayatri
COu L Permament Address colonyadhpul
Behyoy Alway LLenL

COutL*\mIIn Multip.le Lime LLend


COutL \n Name Rahil 12endd
SHRI BALAJI STATIONERS O
8949469034

M. B. M. UNIVERSITYY
NVERSI
Y J O D

JODHPUR
Date Experiment No. ... .... P. No...4
*
Name... . Faculty No. ....Class.. Batch..
Cout L RalLL No. |234 2emdh
Cout LL CJass B.E Ld Sem
LLends
Cout LL Local Address 1 gayairi Colonyiodhpuy LLendl
Caut L Permanenk AJdrss Behro Alway
etch O:
OUT PUT
Addition is 13
Subtracfiom is 7
Multirlicatio is 30
30
Division s 3
Module is 1
SHRI DALAJI STATIONEHS 8049469034

M. B. M. UNIVERSITY
NvERS
OOH
JODHPUR
Date Experiment No. 2
.. P. No....
Name R9his..kuma. Sain... Faculty No. . . . . ....Class.. ..i.. Batch...
083ECT
Wite a P7oqram me n Iurbo c** that
Prink the Sum DiffeTence MultiplicationQuatienf
andRemaimdex ot two imie 9e numbexx.
Iniialine the intge wih Values lo and 3

inclade LLonio h2
include L iostream.h 2

Void main O

imta o b3

Cout L Addiiom is LLa+bLLend


Couk L Substxac h9m is La-b endd.
CouA LL Mul.kiplication is : LL ax b Lend
COu LL ivision is:21Lal b lLendL
Cou LL Module is LL a/ b

tch O:
OUT PUT
Enter First number 4
Entey Second number

Adaition is 20
Subsivaction i s s
MulsiP1i Caion is S4
Division is 2
Module s
SHRI BALAJ STATIONERS 9 8949459034

M. B. M. UNIVERSITY
UNVwVERSI
JooH
JODHPUR
Date . Experiment No. 2. .. P. No....6..
NameR.hi...Kumax..Saini.. Faculty No. .Class. Batch...

0BTECI1
wriiea PzogIam in tuubo Ctt_that
Prints Sumdiffexeace multiplicakion uokienA
amd eminds btwo iniegea mumbers
Ihe Tntt ge yalues are o be Entered by user

F incAude L Canin h
t imclude 1iostream.h2

Void main

ClscyU
inta, b

COu LL Ent fixst mumbe "


Cin2 a

Couk L2 Enkex Second Numbe

Couk LL\n Addikion is " L2 (a )LL endl


SHRI BALAJI STATIONERS 8949469034

M. B. M. UNIVERSITY
M.
JODH
MUNNE
JODHPUR
Date Experiment No. ************* ... P. No... ******

Name. .. Faculty No... .....Batch..


....Class..

Cout LLN Substxaction is la-b)LL ehdd


Cout LL Mulkiplica.iom is "LLLa*)LL endl
Cout L nivision is:"LLla/b)Lendi
Cou L Madule is :"LL la/.b)

etch O
3
OUT PUT
fov he re- inere ment
6

Fo7 he Post-incvement
6

For he Pe-decvemant
6

FoY he Post - decrement


SHRI BALAJI STATIONERS 8949469034

M. B. M. UNIVERSITY
VERSIT
J O D

JODHPUR
Date. Experiment No. 2
******************* ** **.** P No.. ******
Name Ronik.Kuma..Saini.. Faculty No. .. .Class..
..Batch....
,...^**
OBJECL.
wite oa Pxog10mme to ndeYstand he
incement ond deCXe me nt ot arithmetic_O peIatoY.

include LConioh2
t incAude 2iostteam h

Void main )

int aS,b
CYscI)

Cout L Foxthe Pxe-incie ment


b4toa LLend
Coui 1L b 11end l1a
1end
Cout LL n for the Pos.t -
b=a+ incYement endl
2Lend
Cout Lb LLend
kLLaLLendl
Cauk LL Fo1 he f 1e-decYe men
bE--a LLendli
SHRI BALAJI STATIONERS 3949469034

M . M. B. M. UNIVERSITY
JOOHPU
UNIERSITY
VE JODHPUR
Date Experiment No. ***. .. P. No.9.
Name ****

.. Faculty No. .
****** *** ....Class.. ..Batch...
CoukLLb Cnd LL a LLCnd J

Couk Im fnx khe Post -decrement LLendA


b-a
COut LLbL emda LLa
OUT PUT
Enter he fiYst number . -
1S.S
Enter he Second mumber
20 9

Sum is 36. o oo02


Average is - 1s. 2o 0 oo 1
SHRI BALAJI STATIONERS 9894946903a

M. B. M. UNIVERSITY
MUNIVER
JOD
JODHPUR
Date. **** Experiment No. .. P. No..1o
... .
Name Ro.his.kumax...$ain. Faculty No. ...ClasS.............batcn........
OBJECI
wTite a ProgTamme to ind the Sum and aveYa 3e
otwn loat mumbea
The numbers axeb beentered by the Sex

Hinclude Lconio-h2
Einclude Liostream.h

Void main

Aoat a b Sum avexae

CouLL Entu he Fixs nwmbe LLend


cin >a

Couk LL Ente he Second mumbez LLemdl


Cin>>b

Sum atb2
average Sum/ _
Cout LL n Sum is "LL Sum LLendLS
Cout LL\n
Aveza9e is : LLaVeTage
ech)
OUT PUT
Tauth able for he ogical AND
oPeato»
SHAI BALAJM STATIONERS
994946903
M. B. M. UNIVERSITY
UNVER
ITY
JOD
JODHPUR
Date Experiment No. .
****** .P.
* No..I.
Name RohidKumny Saini.. Faculty No ....Class. .....Batch. **

OBJECT
wite a
Pyog1a mme demoS.ktate heJr th
tableof lagAcal AND OPexatoy

nclude 2comio.hb2
mslude Liostieam h

Vid ma in

ini a :10 b11 C: 22

Coui LL Tuh table or _the Jogical AND


ope1atny Lend!|
Cout LL endi L

CouiLloh)LL Llaze)1 "LLa>b LA ae)Lendt


CtLLlazb)L "LLUb2a)L L "LLlash t4 b>aliend
CDutLLb "La2b)L Lb>a Jt a>b)22end
CudLLlb>a) "LLC2a)L1 LLb2a d4 Ca )LLendi

tchO
OUT PUT

Tuh able fz he Aoaical oR 0PeTat y


SHR BALA STATIOES s s 4

M. B. M. UNIVERSITY
ODHU
VERS JODHPUR
Date ******
Experiment No. . .... P. No..J.4...
************ *** . . . . . ..

Name Rohi..kwma.).. Sain. Faculty No. .

. Ciass.... ...Batch

O8JECCI
Wzidea Piag1amma o demostrate he
Luth nblso lngical OR 0Piani.

Hinckuds Lcanio h 2
inLkud L io sttam.h2

Noid main

ini as10 b1 22
CYscyC)_

CouA LLTuh kabls ni the Jogical 0R


0Pe1atoyi"2uind
Cout Llab)L lase)L"_ LLlash 1 a>e)LLendi
CoutLla>b)LL LLb>a) 1L "ulah llb>a)lLendLL
CautLha)L "Llab)Lz ' hba l ah)LL endd
Caut LLtb>a) LL LL a) LL LLb>a ll c>alii ndi
OUT PUT
TTuth table fo the Logical NOT OPerator
O
SHRIBALAJ STATIONERS s94945904u
M. B. M. UNIVERSITY
rVERS
JOD
JODHPUR
Date Experiment No. * *** . P. No..1.3..
******** *
NameRehi.kum9x.Saini.. Faculty No.... *..o......laSS........
....Batch.... ****

OB3ECT
write a Progxamme b Jem.oskrata utrth
ableof Jogical NOT opaYaor

nclude 1 Comio h .
H includa L iostram.h

Void main )

ini e 6 b=12 C-19

Cout L uth able r the Jogic al NoT_opeya tn y LandA;

Couk LL ha)u 1L !Ch>a) L1end

Cout LLLO) LL LL L)

2tchU
OUT PUT

Fox Cnad to 0Pevatox o

Foy Not eual to oPeTato Y 1

Fo GYeatty than 0Peakoy 0

FoYLess han ofeato y - 1


FoxGreatey than e ual to 0PeTa tox - O
for Less tha eaua to 0Pea tov - 1
frpe
ata
SHRI BALAJI STATIONERS9 8949469034

M. B. M. UNIVERSITY
UNVEERSITYndHOOr JODHPUR
P. No..
Date Experiment No.
Faculty No... ..Class.. . Batch..
Name .Rahis...kumaY..SAIn..

OB3eCT
Ho o imple man.t_Rekakional0peiators
i n tAYho c4*|

Einclude 1 Conio.hz
inckude Lio Streamh2.

Veid main )

Clrscy)

CDu LL for Eaua k 0psiaks LLla-bllendk


CAuLL EniNat Caua n opgako L(al-b)LLend
IcouLL Fox artatythan
0pedatoy-LLCazbll1end
CouL h1 Less ham 0PeKakoy "ILCaLb)LLendd
Cou LLhi hIeatuy than equsal n opexakor -"1L(a>sb)LL endi
CouL Foy Less than equa to apeXatny- LaL-b)
OUT PUT
=12
AND 0Peratov
Fo
For Bitwise

For 0itwise OR OPeYator 61


OPeTator = yg
Fox BitwiSe XOR
oPeato y =
-

61
Fox Bitwise Com Plement
2yo
ForBitwise Lef shift 0Peraor

shift oPeratoY 5S5


Fo
Foy Bit wise Right
SHRI BALAJI STATIONERS 8949469034

M. B. M. UNIVERSITY
JODHPU
UNNENERS JODHPUR
Date Experiment No. . . S . P. No..S..
NameRehid..kumaX.Saimi.. Faculty No. . . lass.........Batch......

OB3eCT
How n implemcnt eitwise 0PeakoySin
kurbactt

#include LiOStyeam.h>
include 2 onio h

Void main )L

int a=60b 13

Cout LL EoY Bikwise AN D OPXatoy =LLadL) LLemdd


Cau LL r itwise OR opeXathr-"LLlalb)LLendi
Cout L ni Bitwise XoR opeKatox "LLLab) LL end
CouiLL y Bitwisg Complemnt opeXatoz
1La)LL endd
C.aL Enx Ditaise Left shifk
opryakoy="LL(aLLn)1L endU
Cat LL Fo1 Bitwise Right shift_opeXaknx
LL(as>)
tchO

You might also like