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
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What do header files do?
What will be your course of action for a push operation?
Process by which one bit pattern in to another by bit wise operation is?
What is malloc and calloc?
What are the types of variables in c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Can you write the function prototype, definition and mention the other requirements.
Do you know pointer in c?
What is a macro?
Define Array of pointers.
Describe the order of precedence with regards to operators in C.
Explain what is wrong with this program statement? Void = 10;
What are the features of the c language?