please tell me the logic for this C program :
INPUT (string):ABCD

OUTPUT :BCDA
CDAB
DABC

Answers were Sorted based on User's Feedback



please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA ..

Answer / 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

please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA ..

Answer / rajan

Circular queue

Is This Answer Correct ?    6 Yes 3 No

Post New Answer

More C Interview Questions

the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

0 Answers  


How can type-insensitive macros be created?

0 Answers  


how to make a scientific calculater ?

0 Answers  


how do you redirect stdout value from a program to a file?

1 Answers  


Linked lists -- can you tell me how to check whether a linked list is circular?

0 Answers  






why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

0 Answers  


How would you print out the data in a binary tree, level by level, starting at the top?

6 Answers   Amazon, Microsoft,


Explain how do you override a defined macro?

0 Answers  


What does %c mean in c?

0 Answers  


What is meant by inheritance?

0 Answers  


Is c still used?

0 Answers  


What are the functions to open and close the file in c language?

0 Answers  


Categories