Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

Problem 5

4 comments on “Problem 5”


  • SK.ISHAN

    #include
    using namespace std;
    void is(string a,int n){
    for(int i=0;i<n;i++){
    for(int j=i;j<n;j++){
    for (int k=i;k<=j;k++)
    cout<<a[k]<<" ";
    cout <>s;
    is(s,s.size());
    }


  • Srimukhi

    IN C
    #include
    int main()
    {
    int i,j,l,k,r;
    char s1[100],s2[100],s3[100];
    scanf(“%[^\n]%*c”,s1);
    scanf(“%[^\n]%*c”,s2);
    scanf(“%[^\n]%*c”,s3);

    for(l=0;s2[l]!=’\0′;l++);
    for(i=0,j=0;s1[i]!=’\0′,s2[j]!=’\0′;i++)
    {
    if(s1[i]==s2[j])
    j++;
    else
    j=0;
    }
    if(j==l){
    for(r=0,k=i-j;s3[r]!=’\0′;r++,k++)
    s1[k]=s3[r];
    }
    else
    printf(“string is not found”);
    printf(“%s”,s1);
    }


  • Mohd Saif

    #PYTHON 😎
    str=input()
    n=len(str)
    for i in range(0,n):
    for j in range(i+1,n+1):
    print(str[i:j])