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

Why is c used in embedded systems?

1114


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

2092


any "C" function by default returns an a) int value b) float value c) char value d) a & b

1080


Can we declare variable anywhere in c?

966


Who invented b language?

1403


What is wild pointer in c with example?

1056


Write a C program to count the number of email on text

1908


what value is returned to operating system after program execution?

2111


What is extern storage class in c?

992


What is p in text message?

978


Explain 'bus error'?

1085


What is calloc malloc realloc in c?

1052


How can I read in an object file and jump to locations in it?

1025


how to make a scientific calculater ?

2067


What is the purpose of clrscr () printf () and getch ()?

1066