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
Is it cc or c in a letter?
why return type of main is not necessary in linux
What does == mean in texting?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Is a house a shell structure?
How can I open files mentioned on the command line, and parse option flags?
Define C in your own Language.
Explain what are global variables and explain how do you declare them?
Describe newline escape sequence with a sample program?
Explain what are the different data types in c?
What is 02d in c?
What is a pointer in c?
What are the types of assignment statements?
What does #pragma once mean?
What is const and volatile in c?