Polnochniy

Untitled

Nov 6th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. setlocale(LC_ALL, "Rus");
  6. int a, b , i;
  7. int rez = 1;
  8. cout << "Введите диапазон" << endl;
  9. cin >> a >> b;
  10. i = a;
  11. while (i <= b) {
  12. rez =rez* i;
  13. i++;
  14. }
  15.  
  16. cout <<"Результат произведения от a до b равен " << " " << rez<< endl;
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment