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
What is a lvalue
What is typedf?
What are derived data types in c?
Does c have class?
Explain the properties of union. What is the size of a union variable
What is the use of bit field?
Explain what are reserved words?
What is hashing in c?
What is restrict keyword in c?
Does c have function or method?
Linked lists -- can you tell me how to check whether a linked list is circular?
Can we use visual studio for c?
Who developed c language?
Explain spaghetti programming?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.