In this page we have shared various types of c programs on various topics like loops,switch case,if-else statement,arrays,strings,pointer,functions,recursion etc.
This page consists of programs from basic c programs to high level c programs.
Search This Blog
Wednesday, June 26, 2019
Write a program in c to find the factorial of a given number.
#include<stdio.h> int main() { int i,n,f=1; printf("Enter the number\n"); scanf("%d",&n); for(i=1;i<=n;i++) { f=f*i; } printf("factorial=%d",f); return 0; }
This comment has been removed by the author.
ReplyDelete