There are 21 people in a room. They have to form groups of 3
people each. How many combinations are possible? Write a C
program to print the same.
Answer Posted / jeeva kumar
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,n,a,b,c=1,d=1;
printf("Enter the tot no of people");
scanf("%d", &n);
printf("In how many they have to form group");
scanf("%d", &a);
b=a;
for(i=0;i<b;i++)
{
c*=n;
d*=a;
n--;
a--;
}
printf("%d",c/d);
getch();
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
How arrays can be passed to a user defined function
Why isn't any of this standardized in c? Any real program has to do some of these things.
What are the 5 data types?
Explain built-in function?
Are negative numbers true in c?
Explain the term printf() and scanf() used in c language?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is malloc and calloc?
What are the differences between Structures and Arrays?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
How can I implement sets or arrays of bits?
What would be an example of a structure analogous to structure c?
What is the difference between printf and scanf )?
i got 75% in all semester am i eligible for your company
Do pointers take up memory?