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 the difference between memcpy and memmove?

608


Explain how can I manipulate strings of multibyte characters?

788


What is c value paradox explain?

582


Can i use “int” data type to store the value 32768? Why?

760


Why void main is used in c?

564






An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

710


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

4910


What are the functions to open and close file in c language?

733


What are the string functions? List some string functions available in c.

611


What happens if header file is included twice?

663


write a program to generate address labels using structures?

4013


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

1790


How can I do serial ("comm") port I/O?

695


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1637


What are linker error?

620