Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

please tell me the logic for this C program :
INPUT (string):ABCD

OUTPUT :BCDA
CDAB
DABC

Answer Posted / sky

char str[]="ABCD";
len = strlen(str);
for (i=1; i < len; ++i )
{
j=i;
for( count=0; count < len; ++count, ++j )
{
if(j == len )
j=0;
printf("%c", (*str)+j);
}

printf("\n");
}

Is This Answer Correct ?    18 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a lvalue

1040


What is typedf?

1066


What are derived data types in c?

1008


Does c have class?

1051


Explain the properties of union. What is the size of a union variable

1130


What is the use of bit field?

1116


Explain what are reserved words?

1041


What is hashing in c?

1101


What is restrict keyword in c?

1050


Does c have function or method?

942


Linked lists -- can you tell me how to check whether a linked list is circular?

1032


Can we use visual studio for c?

1009


Who developed c language?

1039


Explain spaghetti programming?

1189


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7988