#include <iostream.h>
#include <conio.h>
#include<process.h>void main()
{
int start, end , flag = 0, r ;
cout<<" \n Enter the number to start with :";
cin>> start;
cout<<" \n Enter the number to end with :";
cin>>end;
if(start>end)
{
cout<<"\n Invalid Input.";
getch();
exit(1);
}
clrscr();
cout<<"\n The Series :\n ";
for(int i = end ; i>=start ; i--)
{
flag = 0;
for(int j = 2; j< = i-1 ; j++)
{
r = i%j;
if(r == 0)
{
flag = 1;
}
}
if(flag == 0)
{
if(i%10 == 7)
cout<< i << " ";
}
}
getch();
}
No comments:
Post a Comment