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
How do I create a directory? How do I remove a directory (and its contents)?
What are the 4 types of programming language?
Where local variables are stored in c?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Differentiate fundamental data types and derived data types in C.
Write a program to print "hello world" without using a semicolon?
how to capitalise first letter of each word in a given string?
What is anagram in c?
What is the use of putchar function?
how should functions be apportioned among source files?
What is the best style for code layout in c?
Define recursion in c.
What math functions are available for integers? For floating point?
Do you know the purpose of 'register' keyword?
What is data structure in c and its types?