Find All Prime Numbers From Zero to N
Find All Prime Number Between Your Given Range
Using DEV C++
Using DEV C++
========================================================================
#include<iostream>
using namespace std;
main()
{
float count=0,n;
cout<<"Enter Number\n";
cin>>n;
cout<<"All Prime Number Below "<<n;
cout<<endl<<endl;
for(int j=1;j<=n;j++)
{
for(int i=1;i<=j;i++)
{
if(j%i==0)
{
count++;
}
}
if(count==2||j==1)
{
cout<<j<<endl;
}
count=0;
}
}
using namespace std;
main()
{
float count=0,n;
cout<<"Enter Number\n";
cin>>n;
cout<<"All Prime Number Below "<<n;
cout<<endl<<endl;
for(int j=1;j<=n;j++)
{
for(int i=1;i<=j;i++)
{
if(j%i==0)
{
count++;
}
}
if(count==2||j==1)
{
cout<<j<<endl;
}
count=0;
}
}
========================================================================
OutPut :
Code By: Kabeer Hussain & Usman Ibrahim & Abuzar Chandio
0 comments:
Post a Comment