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

what is a constant pointer in C

686


Can we declare variable anywhere in c?

543


What is bubble sort in c?

646


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

665


What do you mean by dynamic memory allocation in c? What functions are used?

662






How reliable are floating-point comparisons?

632


How do we open a binary file in Read/Write mode in C?

687


Why doesnt that code work?

604


What is the difference between malloc() and calloc() function in c language?

610


Is calloc better than malloc?

586


Write a program to reverse a string.

644


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

724


Combinations of fibanocci prime series

1118


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

657


Differentiate between the = symbol and == symbol?

723