Write a C program to find the factorial of any number.
#include<stdio.h> #include<conio.h> main() { int n; long int fact=1; printf("\n Enter any number"); scanf("%d",&n); if(n==0) printf("\n The result=%d",fact); else { do { fact=fact*n; n--; }while(n>0); printf("\n The result=%d",fact); } getch(); }
Output:
Write a C program to convert decimal no. to binary.
What is tree traversal?