Advertisement
anon20016

Untitled

Dec 8th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. setlocale(LC_ALL, "Russian");
  8. // вывести все четные числа до 100
  9. for (int i = 2; i <= 100; i = i + 2) {
  10. printf("%d ", i);
  11. }
  12.  
  13. printf("\n");
  14. // вывести все степени 2 до 1000
  15. for (int i = 1; i < 1000; i = i * 2) {
  16. printf("%d ", i);
  17. }
  18.  
  19. printf("\n");
  20. // вывод чисел от n до 1
  21. for (int i = 25; i >= 1; i = i - 1) {
  22. printf("%d ", i);
  23. }
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement