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 / 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 |
int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
#include <stdio.h> int main(void) { int a=4, b=2; a=b<<a+b>>2 ; printf("%d",a); return 0; }
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
main() { int a[10]; printf("%d",*a+1-*a+3); }
main() { char *p = “ayqm”; char c; c = ++*p++; printf(“%c”,c); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }