

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The code for a c program designed for pattern matching. The program reads input text from a file and searches for a given pattern in it. The pattern is defined as a string 'aaba' in this specific implementation.
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Pro actical No. Dote: G//
Am: Write o prognam or Patfenn Motchicg
5oftuaoe Requiod ova Online Cormpile
include<stdio.h>
break
int main ) chan xt AABAACAADAABAAA BAA": Chon po+ AABA 5onth pat, t x t et unn O
Patlenn found a ndex O Poenn found at index 9 Paltenn (^) found ot (^) ndex (^13)
cASSMAte Date:6I22Page: Pracico No. 1
Aim: WNeite a pnogeam fon Pateno Matchiag-
50fHuuaoe Requioed Tava Onliae Compilen.
Pnoqeam Code iecudecstdio.b includesstníag.h vaid scancb^ (^ chan^ pot^ chan^ *fxt.
int ME Stnlea Cpat), int N=6tnlen(txt fon Lint i=o i=N-M:it tatS fon i0, jkM,jt) iiftxtri+ i1=pat )
priatECCPatiro ound at index od \n D
iat main) char *xtAABAACAADAARAAA BAA
SeanchLpattxt peuna
Output: Patlena ound at iodex o
Patkennfound ot iodtx Patten aunol atedex 13 Conclu6lan Pa no Matchinq lets uo angaoize the cad as metehin9 patlenns tbeexecukd when the