Skip to content

pchp250g8-home-cpp-tutorials/bcc-cpp-console-finddividersofnumber

Repository files navigation

FindDividersOfNumber. C++ Tutorials. Embarcadero Rad Studio IDE. Simple Input/Output. Algorithms. Windows Platform. Console Application.

A console application in the C++ programming language. The program does the following:

  1. Asks the user to enter a positive integer.
  2. The message displayed is: "The number has the following divisors:"
  3. The loop with the parameter is executed:
    1. The initial value of the parameter is set to 1, and the final value is set to the number entered from the keyboard.
    2. A series of loops is executed, where the remainder from dividing the number entered from the keyboard by the loop variable-parameter is calculated.
    3. If the remainder is zero, the value of the loop parameter is displayed on the screen.
    4. The value of the loop parameter is compared with the final value. If it is less, the loop is executed. Otherwise, it terminates.
    5. The loop parameter variable is incremented by the loop increment. In this example, it is 1.
  4. The program waits for the "Enter" key to be pressed before terminating.

Developed in the Embarcadero Rad Studio integrated environment.

FindDividersOfNumber. ИС Rad Studio. Занятия по C++. Простой Ввод/Вывод. Алгоритмы. Платформа Windows. Консольное приложение.

Консольное приложение написанное на языке программирования C++. Программа делает следующее:

  1. Просит пользователя ввести целое положительное число.
  2. Выводится сообщение:"Число имеет следующие делители:"
  3. Выполняется цикл с параметром:
    1. Начальное значение параметра уставливается равным 1, а конечное - числу, введённому с клавиатуры.
    2. Выполняется серия цикла, где вычисляется остаток от деления числа, введённого с клавиатуры на переменную-параметр цикла.
    3. Если остаток равен нулю, то значение параметра цикла выводится на экран.
    4. Значение параметра цикла сравнивается с конечным. Если оно меньше цикл выполняется. В противном случае - завершается.
    5. Переменная параметра цикла увеличивается на шаг цикла. В данном примере он равен 1.
  4. Программа ждёт нажатия клавиши "ввод" перед завершением.

Разработано в интегрированной среде Embarcadero Rad Studio.

About

FindDividersOfNumber. C++ Tutorials. Embarcadero Rad Studio IDE. Simple Input/Output. Algorithms. Console application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors