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 #4775 from NexTheMighty/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 3eb94fa + dca0e64 commit 27a87ed
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions C++/Primorial.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
int primorial()
{
int number, i, j, sum = 1;
bool prime;
cout << "Enter a number: ";
cin >> number;

for(i=2;i<=number;i++)
{
prime = true;
for(j=2;j<i;j++)
{
if(i%j==0)
{
prime=false;
break;
}
}
if(prime)
{
sum *= i;
}
}
cout << number <<"# = " << sum;
return 0;
}

0 comments on commit 27a87ed

Please sign in to comment.