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 |
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
Why is c faster?
Is main an identifier in c?
What is a structure in c language. how to initialise a structure in c?
How can I sort a linked list?
how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]
What is function prototype in c with example?
write a c program to print "Welcome" without using semicolon in the whole program ??
What is the difference between text and binary i/o?
how can we Declare a variable in c without defining it.
Do you know the difference between malloc() and calloc() function?