Docsity

Linux practical for sy bca students, Cheat Sheet of Linux skills

Partial preview of the text

Download Linux practical for sy bca students and more Cheat Sheet Linux skills in PDF only on Docsity!

2 January 1, 2002 /*PRACTICAL NO:12*/ PE A C PROGRAM IN LINUX TO CALCULATE FACTORIAL OF A /*PRACTICAL NAME: DEVELO NUMBER * / /*ROLL NO: 02*/ #include main() { int i,fact=1,n; printf("Enter the value of n\n"); scanf("%d", &n) ; for (i=1;i<=n; i++) { fact=fact*i; } } /*OUTPUT*/ Enter the value of n 5 : The factorial of © given number is 120 printf£("The factorial of the given number is %d", Scanned by TapScanner Page