Advertisement

DIVIDED BY EACH 2 NUMNER ONLY RESULT SHOW HIGH NUMBER TO LOW NUMBER(LIKE 5 OR 7)

#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int a,b,c,d,e;
cout<<"ENTER STARTING NUMBERn";
cin>>a;
cout<<"ENTER ENDING NUMBER\n";
cin>>b;
cout<<"--------------OUTPUT-------------";
{
for(c=a;c>=b;--c)
if(c%7==0&&c%5==0)
cout<<c<<"\n";
}
getch();
}


//YOU ENTER  5 TO 150
//OUTPUT 140 ,105,70,35


Post a Comment

0 Comments