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.



There are 21 people in a room. They have to form groups of 3 people each. How many combinations are..

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

Post New Answer

More C Interview Questions

What does c mean in basketball?

0 Answers  


What are qualifiers?

0 Answers  


main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????

1 Answers  


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

0 Answers  


What is nested structure?

0 Answers  






What is an auto keyword in c?

0 Answers  


Why array is used in c?

0 Answers  


Write a program to generate the first n terms in the series --- 9,11,20,31,...,82

1 Answers   Cognizant,


Explain how do you determine a file’s attributes?

0 Answers  


union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }

3 Answers  


How many data structures are there in c?

0 Answers  


What are pointers really good for, anyway?

0 Answers  


Categories