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

write a string copy function routine?

2 Answers  


How can I do peek and poke in c?

0 Answers  


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers   Calsoft,


#define d 10+10 main() { printf("%d",d*d); }

6 Answers  


WHAT IS ABSTRACT DATA TYPE

4 Answers   Wipro,






what type of questions arrive in interview over c programming?

0 Answers  


Which control loop is recommended if you have to execute set of statements for fixed number of times?

0 Answers  


what is c++ programming?

3 Answers   TCS,


How do I round numbers?

0 Answers  


What is the difference between int main and void main?

0 Answers  


What are the different types of constants?

0 Answers  


write a program that explain #define and # undef directive

1 Answers  


Categories