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 / 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 |
triangle number finding program...
When should a far pointer be used?
Write a program with dynamically allocation of variable.
Do you know what are bitwise shift operators in c programming?
Differentiate between full, complete & perfect binary trees.
Do you know what is the purpose of 'extern' keyword in a function declaration?
write a program to swap two numbers without using temporary variable?
how to write optimum code to divide a 50 digit number with a 25 digit number??
consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none
Why c is a procedural language?
can v write main() { main(); } Is it true?
what is a stack