#include <iostream>
#include <math.h>
using namespace std;
void FindPrime(int start,int end)
{ int i,j,x,c=0,s=0;
for(i=start;i<=end;i++)
{
x=sqrt(i);
for(j=2;j<=x;j++)
if(i%j==0)break;
if(j>x){
c++;
s+=i;
cout<<i<<" ";
if(c%5==0)
cout<<endl;
}
cout<<"\nprime total number is "<<c<<",sum is "<<s<<endl;
void main()
FindPrime(50,100);
#include <iostream>
#include <math.h>
using namespace std;
void FindPrime(int start,int end)
{ int i,j,x,c=0,s=0;
for(i=start;i<=end;i++)
{
x=sqrt(i);
for(j=2;j<=x;j++)
if(i%j==0)break;
if(j>x){
c++;
s+=i;
cout<<i<<" ";
if(c%5==0)
cout<<endl;
}
}
cout<<"\nprime total number is "<<c<<",sum is "<<s<<endl;
}
void main()
{
FindPrime(50,100);
}