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
What are the types of unary operators?
write an algorithm to display a square matrix.
program to convert a integer to string in c language'
What is c token?
How can you restore a redirected standard stream?
what are the facialities provided by you after the selection of the student.
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
Explain the Difference between the New and Malloc keyword.
Is c easy to learn?
What is the difference between pure virtual function and virtual function?
How can a program be made to print the line number where an error occurs?
Explain setjmp()?
What is 2c dna?
Is file a keyword in c?
Can static variables be declared in a header file?