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 / 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 |
Why static is used in c?
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
What is a program?
Why is c still so popular?
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
How many loops are there in c?
What is the use of a conditional inclusion statement in C?
What is call by value in c?
What is header file definition?
Which is the memory area not included in C program? give the reason
what is use#in c
Why do we use int main?