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
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Explain how can I pad a string to a known length?
What are the types of i/o functions?
What is a pointer in c?
Why main is not a keyword in c?
How can I prevent another program from modifying part of a file that I am modifying?
What are global variables and how do you declare them?
What does the error message "DGROUP exceeds 64K" mean?
When was c language developed?
Is calloc better than malloc?
What is assert and when would I use it?
what are the facialities provided by you after the selection of the student.
What is the use of header files?
Why is c not oop?
Explain what is the difference between a free-standing and a hosted environment?