Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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.



There are 21 people in a room. They have to form groups of 3 people each. How many combinations are..

Answer / jagadeesh

#include<stdio.h>
long int fact(long int n);
void main()
{
long int p;
p=fact(21)/(fact(18)*fact(3));
printf("%ld",p);
}
long int fact(long int n)
{
if(n==0||n==1)
return 1;
else
return n*fact(n-1);
}

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C Code Interview Questions

void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


Write a c program to search an element in an array using recursion

1 Answers   Wipro,


Write a program to print a square of size 5 by using the character S.

6 Answers   Microsoft,


void main() { int i=5; printf("%d",i+++++i); }

3 Answers  






How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

0 Answers  


void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }

3 Answers  


How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


how to swap 3 nos without using temporary variable

4 Answers   Satyam,


main() { int a[10]; printf("%d",*a+1-*a+3); }

1 Answers  


main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

4 Answers   CSC,


main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

1 Answers  






Categories