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

Is it cc or c in a letter?

979


why return type of main is not necessary in linux

2060


What does == mean in texting?

1237


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1960


Is a house a shell structure?

1123


How can I open files mentioned on the command line, and parse option flags?

1032


Define C in your own Language.

1041


Explain what are global variables and explain how do you declare them?

1104


Describe newline escape sequence with a sample program?

1082


Explain what are the different data types in c?

1183


What is 02d in c?

1038


What is a pointer in c?

1454


What are the types of assignment statements?

1026


What does #pragma once mean?

1121


What is const and volatile in c?

1001