You are on page 1of 11

Expt No.

Implementation of Frror Deteetion Error Correction Techniques


Date
25los22
Am
W'rite down the PrOgram code tor erTor detection and comection using C
Language
Hardware and Software Requied
A PC with Turbo C

Algorithm:
Error Detection:

1) mynuut the H lits data

A) Chick thu naiuty Aits anl couq o CVUy

Source Code:

miluUL stdlo.hs
vtld mainc)

n t dataC10] ) data.uc Lol C,C1,c2 C3,


ptintf
stanL C"%d " ctata [31)
antC#)%d", dala [6] )
San C"A", au ditta Lt )
lataC1E datat 3)A data [6] Aclafu l71;
Authl 1 data l'31 n daa [ 61 A datalrj
dlkat4J clabu [5) nolata L 6] A dta t 1
/puinnt (" \n éncorttul
data is n'")
o Cj z; J>o; f- - j
vuntf. C" Yct , claft. tiI)
ptytf (" \n"),
phintg ("ntes stceieul data l t on lyme:" )
ptn C"\m )

C1 data ecL61dita cLYTlaa sieles aaja,


C2 dala ucTs]1dat suC terdata UcEIJUea
C3 letoj
lala fuc C31 data Mccr data uc li3
C hdalelu t
T C2 2 +C
Cc= o)
tf CNo Clo
uuu tanumuison Odal \n")

ment ("Ee 0n polton Ac):


pwint n Aain
eurty, ?),
aintf (uY d' da sectis )

Cdaka itc
[7-C1
dat ut [7- c]
= =
o)
1,
olara uT 7-
1ok Cte CIz o
C7 +t
Chupuut
Cass 1:- ent 4.00 dafa me.lg 0n

mcoccc daba
entrt toe ecaiucel Urfs ne m

Algorithm-

No eBgotlutt timemiHn T date

Code:

mordcl dafe

11 1
1 17
Entu

olata Leernel- 011 z 1 1


Cetyee nella G
3
11 7 1
Expt No: 2

Implementation of Stop and Wail P'rotocol and sliding window

Date: 0110912
Aim:
Write a C++t and C program respectively to implement the Stop and Wait Protocol and
Sliding Window Protocol.

Hardware and Software Required


A PC with Turbo CC++ Complier

Algorithm:
Stop and Wait Protocol:

Program
#incdutl e stalio. hs
# n u l cou0. hs
#mlude steltb.hs

rTll maumc)

tnt tJno homu, X,xi =10, x2


no iomu 10;
1
puntf "Mumbes o homus is 7o, no fomu ):
9uhcht)
ulult Cnoflamu so)

eht4 C*Xnl Andtiyfamu is 7. i)


* Tak ) % 10
7
KY. 10 = =o)

o1 (x2 1, *2 L t2 t)
h n lC In u a i t ? fo1 7. d scconolt \ntp)

sleep Cra);

ln't),
ne'rt (" Pack fo1 ftavlas 9
0 a l c l )). so

nofaml= nofmU!

J++

unt Ca/n cnd dfstop ond twaL hilocol Ynt).


qteh1
Output:

nummbe d an A 10

sndiny ome is 2
4Jaltung &CCOYC
nauh
nah fo 2
SmCLeory AameS 3
waing 1cIma
auk fo f1ame as Y, a

fisme
stnadtig Aomu i 66nak fL sarne5

Snarig 1ome 7 1aek fe


sendly

Peme 10 aK fol f1ane 16


natoy
uan gistrs
end slop and
Expt No:4

Implementation of HDLC Protocol

Date:1510l82
Aim
Implement the HDLC Protocol using C Languagge.

Hardware and Software Required


A PC with Turbo C/C++ Complier

Algorithm:

Program:
#mdud 2 tdto.hs
t theludliE Auny:s
nt aavnt )

mt aL201, bl 307,1, j, k, cot1 n)

Stanf T"%d ", &n)

fai ci-o jt<n+ t)


Scanh"),d " 2aLÍ1)
Cwnt 1

duilt ct'n)
Cact- =1) 17

Kt
(R =t1 alr7= =1R%k en R auné 25
Count t t
Cotunt=6)

S++
bESJ = 0

b Ey l=4Cil;

C+t
j+
uinCAtu a* Stuftg )
Output: U i l f
lluin 0 ' Cruut
Gnte ttee frannc 'ze
nt
O

Attu 1i Myuiy: 01111 1 010

Resul t e piegor d HDLCnwleal uasinJne


md ceutel
Expt No: 6

Implementation ol Eneryption and Decryplion Algorithms using C


Language
Date: GbltQ|a2
Aim:
To implement the Encryption and Decryption Algorithms uSing C Language
Hardware and Software
PC with C Compiler

Algorithm

Program:

inti
chaA sÖ C1001, data C1001;

puntg ( 1n éntei ttu strenye:"


getestr) sCang[ */s ",Atu);
In
pEA: Eny fu Murg ")

carf C"LAR)

25

1 ef0 0o Tij = '10')i


data t') -jt tij+ 3
(n Enlsptert pubg: / s\nyrte
puaks
Ca 2

olala i1 =dala (rl-3


pitnty ( nDrhyntel stutorg ) debt)
pAucle
difaul

etetct
Output:
mt t u sMlu: kCa

1! enctynt Cte ury


i dcisA

ncyntl RLuG nf

Chooy
1: nctymt tiyptuy

28

You might also like