Write a program to write a given string in maximum
possibilities?
i.e str[5]="reddy";
i.e we can write this string in 120 ways
for that write a program
Answer Posted / sunil singh
Here is an example program...
#include "stdafx.h"
#include "string.h"
int recursive(int length)
{
if ( length <= 1 )
return 1;
else
return length*recursive(length-1);
}
int main(int argc, char* argv[])
{
char data[] = "ready";
printf("maximum possibilities - %d \n", recursive
(strlen(data)));
return 0;
}
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
When would you use a pointer to a function?
Write a program to use switch statement.
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What is a macro, and explain how do you use it?
What are the different data types in C?
How are 16- and 32-bit numbers stored?
What is typedf?
Write a code to generate divisors of an integer?
Is array name a pointer?
How to write a multi-statement macro?
What is a union?
how we can make 3d venturing graphics on outer interface
What is dynamic memory allocation?
How can I handle floating-point exceptions gracefully?