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
Why is c used in embedded systems?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Can we declare variable anywhere in c?
Who invented b language?
What is wild pointer in c with example?
Write a C program to count the number of email on text
what value is returned to operating system after program execution?
What is extern storage class in c?
What is p in text message?
Explain 'bus error'?
What is calloc malloc realloc in c?
How can I read in an object file and jump to locations in it?
how to make a scientific calculater ?
What is the purpose of clrscr () printf () and getch ()?