Permutation of 'abcd ' - C Program

Program:
#include<stdio.h>
#include<string.h>
int main()
{
    int i,j,k;
    char str[20];
    strcpy(str,"abcd");
    for(i=0;i<strlen(str);i++)
        for(j=0;j<strlen(str);j++)
        {
            printf("\n");
            for(k=i;k<=j;k++)
                printf("%c",str[k]);
        }
    printf("\n\n\n");
}

Output:
nn@linuxmint ~ $ gcc c29.c
nn@linuxmint ~ $ ./a.out

a
ab
abc
abcd

b
bc
bcd


c
cd



d


nn@linuxmint ~ $

3 comments:

  1. I have read your article, the information you give is very interesting.

    Motorwars2.com
    Bulletforce.org

    ReplyDelete
  2. This blog from 2009 offers a comprehensive C program for permutations of 'ABCD,' which is incredibly valuable for programming enthusiasts and students. It demonstrates a strong commitment to sharing knowledge. For those seeking Nursing Assignment Help Online, Assignment Help Pro provides reliable online support.

    ReplyDelete
  3. I found this blog post on permutations in C from 2009 incredibly informative and well-written. It's a valuable resource for anyone interested in programming. Additionally, I'd like to mention that if you're looking for Help with Management Assignment, Do My Assignment is a reliable service that can help you excel academically.

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...