Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

Commit

Permalink
Merge pull request #4768 from abstatic/master
Browse files Browse the repository at this point in the history
Merged by aniket965
  • Loading branch information
Aniket965 authored Oct 18, 2018
2 parents be21e35 + 3ac5178 commit 5cc84dd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions C/abhishek.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include<stdio.h>
int main()
{
int c, n;
unsigned long fact = 1;
printf("Enter a number to calculate its factorial\n");
scanf("%d", &n);
for (c = n; c >= 1; c--)
fact *= c;
printf("Factorial of %d = %lu\n", n, fact);
return 0;
}
15 changes: 15 additions & 0 deletions Java/successive_mult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class factorial
{
void main()
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int f=1;
for (int i=2;i<=n;i++)
{
f=f*i;
}
System.out.println(f);
}
}

0 comments on commit 5cc84dd

Please sign in to comment.