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 the difference between memcpy and memmove?
Explain how can I manipulate strings of multibyte characters?
What is c value paradox explain?
Can i use “int” data type to store the value 32768? Why?
Why void main is used in c?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What are the functions to open and close file in c language?
What are the string functions? List some string functions available in c.
What happens if header file is included twice?
write a program to generate address labels using structures?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
How can I do serial ("comm") port I/O?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What are linker error?