write a c++ program to display the even number 10-30
Answers
Answer:
The below code should work.
Explanation:
#include <iostream>
using namespace std;
int main() {
int FN;
cin >> FN; cout << "First Number: " << FN << endl;
int LN;
cin >> LN;
cout << "last Number: " << LN << endl;
if (FN == LN){
cout << "error";
}
else{
if (FN > LN){
int t;
t = FN;
FN = LN;
LN = t;
cout << "Move The First Number To The Last Number! " << endl;
cout << "First Number: " << FN << endl;
cout << "last Number: " << LN << endl;
}
if (FN % 2 == 0){
while (FN <= LN){
cout << FN << " - ";
FN = FN + 2;
}
}
else{
FN = FN + 1;
while (FN <= LN){
cout << FN << " - ";
FN = FN + 2;
}
}
}
cin.get();
cin.get();
return 0;
}
please mark ❣️ brailist please bro it's a very necessary for me