Question: Write a C program that reads two strings S and T and an integer N. Check if string T occurs in the suffix of S

Write a C program that reads two strings S and T and an integer N. Check if string T occurs in the suffix of S starting at position N.

Note:

Strings are indexed from 0.

The suffix of S starting at position N is the last |S|-N characters of S. |S| is the length of S.

Input Description:

String S

String T

Integer N

Output Description: Print 1 if string T occurs in string S after position N, else print 0.

Example:

Input:

abcdbca

bc

4

Output: 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!