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 does c value mean?
What the different types of arrays in c?
What are the various types of control structures in programming?
How do you generate random numbers in C?
The statement, int(*x[]) () what does in indicate?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are structure types in C?
What is time complexity c?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
What is the size of array float a(10)?
What is the use of void pointer and null pointer in c language?
Is there any possibility to create customized header file with c programming language?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.