📜  使用 for loop c++ 代码示例打印所有偶数

📅  最后修改于: 2022-03-11 14:44:56.054000             🧑  作者: Mango

代码示例1
#include #include  using namespace std; int main(){     int number;     int min=10,max=50;      cout << "Enter the minimum range: ";     cin >> min;      cout << "Enter the maximum range: ";     cin >> max;     cout << "even numbers in given range are: ";     for(number = min;number <= max; number++)          if(number % 2 ==0)           cout << number << " ";      return (0); }