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


Please Help Members By Posting Answers For Below Questions

Is c high or low level?

573


What is union and structure?

567


What is the difference between pure virtual function and virtual function?

643


What is c preprocessor mean?

781


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1793






Explain the bubble sort algorithm.

638


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

597


What is return type in c?

635


Explain what’s a signal? Explain what do I use signals for?

606


What is a nested formula?

599


Write a program to swap two numbers without using third variable in c?

611


Do array subscripts always start with zero?

776


What is wrong with this program statement?

604


What are the types of data files?

723


Explain what is #line used for?

603