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
what is a constant pointer in C
Can we declare variable anywhere in c?
What is bubble sort in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What do you mean by dynamic memory allocation in c? What functions are used?
How reliable are floating-point comparisons?
How do we open a binary file in Read/Write mode in C?
Why doesnt that code work?
What is the difference between malloc() and calloc() function in c language?
Is calloc better than malloc?
Write a program to reverse a string.
#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); }
Combinations of fibanocci prime series
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Differentiate between the = symbol and == symbol?