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 |
praagnovation
print 1-50 with two loop & two print Statement
What are the __date__ and __time__ preprocessor commands?
write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised
if we take a number as a char then can we manipulate(add, subtract) on this number
What is a sequential access file?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
2 Answers HCL, IBM, Satyam, Vimal, Vimukti Technologies,
Where are some collections of useful code fragments and examples?
What are the similarities between c and c++?
What are 'near' and 'far' pointers?
What is #define?
What is an arrays?