F
fool
Dear group,
Given a string I have to print the permutation, using some
looping tricks. This is not a Home work problem. My best
try as beginner is:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
char p[] = "abcd";
int i,j,k;
for(i=0;i<4;i++)
{
printf("first = %c\n",p);
}
printf("\n");
for(i= 3 ; i < p ; i--)
{
printf("second = %c\n",p);
}
printf("\n");
for(i= 2 ; i <= p ;i++)
{
printf("third = %c\n",p);
}
return 0;
}
The first two for loops prints abcd and dcba. But I am
not able to proceed further. Can any one guide me. Pls
don't write the program instead pls give me a hint. Thanks
for any help.
Given a string I have to print the permutation, using some
looping tricks. This is not a Home work problem. My best
try as beginner is:
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
char p[] = "abcd";
int i,j,k;
for(i=0;i<4;i++)
{
printf("first = %c\n",p);
}
printf("\n");
for(i= 3 ; i < p ; i--)
{
printf("second = %c\n",p);
}
printf("\n");
for(i= 2 ; i <= p ;i++)
{
printf("third = %c\n",p);
}
return 0;
}
The first two for loops prints abcd and dcba. But I am
not able to proceed further. Can any one guide me. Pls
don't write the program instead pls give me a hint. Thanks
for any help.