TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ken H
NA
646
360.7k
Combinations number in c language
Dec 21 2013 7:22 AM
hello friend,
How to use a combination number of non-recursive functions?
// Codes:
#include<stdio.h>
void C(
int
a[],
int
n,
int
m){
// How to do it?
}
void C(
char
b[],
int
n,
int
m){
// How to do it?
}
void
main()
{
int
a[5]={1,2,3,4,5};
char
b[]={"abcde"};
C(a,5,3);
//
It should be 10 combinations.
C(b,5,3);
// Same as above.
}
Here is its formula:
Such as:
C(a,5,3);
It will print the following information:
123
124
125
134
135
145
234
235
245
345
Total:10
C(b,5,3);
It will print the following information:
abc
abd
abe
acd
ace
ade
bcd
bce
bde
cde
Total:10
Please use a non-recursive method to solve it(Do not use the system to provide any built-in functions). And explain its problem-solving ideas.
Thank for you.:)
Reply
Answers (
8
)
Double precision data type conversion in c language
Using a recursive parameter problem