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

praagnovation

0 Answers  


print 1-50 with two loop & two print Statement

2 Answers  


What are the __date__ and __time__ preprocessor commands?

0 Answers  


write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised

3 Answers  


if we take a number as a char then can we manipulate(add, subtract) on this number

2 Answers  






What is a sequential access file?

0 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

2 Answers   HCL, IBM, Satyam, Vimal, Vimukti Technologies,


Where are some collections of useful code fragments and examples?

0 Answers   Celstream,


What are the similarities between c and c++?

0 Answers  


What are 'near' and 'far' pointers?

0 Answers  


What is #define?

0 Answers  


What is an arrays?

0 Answers  


Categories