C program to find factorial of a number using function

/*WAP to find factorial of a number using function*/ #include<math.h> #include<stdio.h> main() { int factorial,n; clrscr(); printf(“Enter the number\n”); scanf(“%d”,&n); factorial=fact(n); printf(“Factorial of a given number=%d”,factorial); getch(); } int fact(int a) { int i,f=1; for(i=1;i<=a;i++) f=f*i; return(f); } Output Enter the number 6 Factorial of a given number=720 Download Program Download

C Program to find largest, smallest of 3 numbers

/*WAP to find largest, smallest of 3 numbers*/ #include<stdio.h> void main() { int a,b,c; clrscr(); printf(“Enter 3 Numbers-\n”); scanf(“%d%d%d”,&a,&b,&c); if(a>b) { if(a>c) printf(“%d Is Largest\n”,a); else printf(“%d Is Largest\n”,c); } else { if(b>c) printf(“%d Is Largest\n”,b); else printf(“%d Is Largest\n”,c); } if(a<b) { if(a<c) printf(“%d Is Smallest\n”,a); else printf(“%d Is Smallest\n”,c); } else { if(b<c) … Read moreC Program to find largest, smallest of 3 numbers