Загрузка...

How to write such a cycle?

Thread in C/C++ created by Cabseel Oct 16, 2023. 162 views

  1. Cabseel
    Cabseel Topic starter Oct 16, 2023 730 Feb 27, 2021
    Есть числовой ряд, ограниченный с двух сторон. Он начинается с левого ограничителя и идёт к правому с определённым шагом. Как это записать через for?
     
  2. nature
    nature Oct 16, 2023 :peace: 267 Mar 13, 2021
    C
    int a1 = 20;
    int a2 = 40;
    int a3 = 2;


    for(int i = a1; i < a2; i+=a3);
     
  3. Plain
    Plain Oct 16, 2023 Policeman swear to God 759 Aug 28, 2022
    C
    int a = 50
    int b = 100

    for(int i = a; i <= b; i+=(шаг))
     
    1. View previous comments (1)
    2. Plain
      nature, да, спасибо, забывать уже начал
    3. View the next comments (2)
Loading...
Top