Program that get start and end point and display even number in given range.
A program that input starting and ending number from the user and show all even numbers in the given range.
using namespace std;
#include<iostream>
#include<conio.h>
int main()
{
int s,e,n;
cout<<"Enter starting number:";
cin>>s;
cout<<"Enter ending numbers:";
cin>>e;
n=s;
while(n<=e)
{
if(n%2==0)
cout<<n<<endl;
n++;
}
getch();
return 0;
}
Program that get start and end point and display even number in given range.
Reviewed by Alpha
on
3/25/2017 09:48:00 pm
Rating:
No comments: