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
Is c high or low level?
What is union and structure?
What is the difference between pure virtual function and virtual function?
What is c preprocessor mean?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Explain the bubble sort algorithm.
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What is return type in c?
Explain what’s a signal? Explain what do I use signals for?
What is a nested formula?
Write a program to swap two numbers without using third variable in c?
Do array subscripts always start with zero?
What is wrong with this program statement?
What are the types of data files?
Explain what is #line used for?