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

How do I create a directory? How do I remove a directory (and its contents)?

1222


What are the 4 types of programming language?

1189


Where local variables are stored in c?

1045


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2466


Differentiate fundamental data types and derived data types in C.

1088


Write a program to print "hello world" without using a semicolon?

1119


how to capitalise first letter of each word in a given string?

1983


What is anagram in c?

980


What is the use of putchar function?

1107


how should functions be apportioned among source files?

1164


What is the best style for code layout in c?

1142


Define recursion in c.

1348


What math functions are available for integers? For floating point?

1184


Do you know the purpose of 'register' keyword?

1068


What is data structure in c and its types?

1113