beingtopper.jkp@gmail.com
+91-7529019575
Free Demo

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us

Being Topper

  • Home
  • About Us
    • Founder’s Profile
    • Franchise
    • Women’s Entrepreneurship Development
  • Blog & Events
  • Modules
    • Website Planning and Creation
    • Social Media Marketing Course
    • Search Engine Optimization
    • SEM/PPC Training
  • Branches
    • Rajasthan
      • Ajmer
      • Jaipur
      • Jodhpur
      • Udaipur
      • Kota
      • Sikar
    • Janakpuri
    • Tilak Nagar
    • Noida
    • Chandigarh
    • Mumbai
  • Contact Us
Algorithm Design and analysis ProgramsB.tech notesC++ programInformation technology

C++ program to perform robin karp string matching

Being Topper Admin 25/05/2013 0 Comments

       WRITE A PROGRAM TO PERFORM ROBIN KARP STRING MATCHING

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{int str[7],mods[7],i,j,len=0,temp[7],substrmod,substrdiv[7],k=0,flag=0;
longint substr1,substr;
clrscr();
for(i=0;i<7;i++)
{temp[i]=0;
mods[i]=-1;
substrdiv[i]=0;
}
cout<<"Enter the sequence<7 character long and use space between 2 characters>:\n";
for(i=0;i<7;i++)
cin>>str[i];
cout<<"\nEnter the substring you want to search in the string:\n";
cin>>substr;
substr1=substr;
while(substr1!=0)
{substr1=substr1/10;
len++;
}
substrmod=substr%13;
i=1;
substr1=substr;
while(i<=len)
{substrdiv[len-i]=substr1%10;
substr1=substr1/10;
i++;
}
for(i=0;i<=(7-len);i++)
{temp[19]=0;
for(j=0;j<len;j++)
{temp[j]=str[i+j];
}
for(j=0;j<len;j++)
{temp[j]=temp[j]*pow(10,(len-(j+1)));
}
for(j=0;j<len;j++)
{temp[19]=temp[19]+temp[j];
}
mods[i]=temp[19]%13;
}
i=0;
while(mods[i]!=-1 && i<7)
{k=0;
if(mods[i]==substrmod)
{for(j=0;j<len;j++)
{if(str[i+j]==substrdiv[j])
k++;
}
if(k==len)
{cout<<"\nString found at position "<<i+1;
flag=1; } }
i++; }
if(flag==0)
cout<<"\nString not found";
getch(); }

OUTPUT :

output for robin carp string matching

Algorithm and design analysis b.tech information technology notes C++ program to perform robin carp string matching C++ program to perform string matching c++ programs robin karp string matching
AboutBeing Topper
"Being Topper, established in 2013, is a premier Digital Marketing Training institute Known for its specializing in digital marketing courses in Delhi. At Being Topper, our carefully crafted training programs are designed to offer learners the practical skills and knowledge essential for a thriving career in today's digital space. Led by certified professionals, the institute delivers top-rated courses that cover key areas, including Social Media Marketing, Pay-Per-Click advertising, content marketing and SEO. With hands-on projects and a focus on industry-specific practices, Being Topper prepares individuals to become effective digital marketing professionals, ready to excel in an increasingly digital-centric world
In Socials:
PrevC++ PROGRAM FOR ACTIVITY SELECTOR25/05/2013
c++ program to perform breadth first search25/05/2013Next
Categories
Recent Posts
  • Vipin Khuttel Inspires Entrepreneurs at Networking Meet in Gurgaon
  • Vipin Khuttel Founder of Being Topper Recognized for Advancing Digital Literacy and Social Empowerment
  • Vipin Khuttel Organizes International Conference for Digital Excellence 2, Elevating the Future of Technology
  • India’s Top Occult Science Enthusiasts Gather at AgyatOnSearch – Awards & Seminar in New Delhi
  • India’s Leading Digital Marketer, Vipin Khuttel Interacted with Top Influencers of Delhi at BJP West Delhi’s Event

Copyright © 2025 Being Topper ® . All Rights Reserved