Skip to content

pchp250g8-home-c-tutorials/c-msvc-console-numofdigits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A console application project written in the C programming language and implemented in the Microsoft Visual Studio integrated environment. The Win32 Console system provides simple input/output. Determining the number of digits in a number entered from the keyboard. The program does the following:

  1. Prompts the user for an integer.
  2. Sets the digit counter variable to zero.
  3. Creates a temporary variable with an initial a positive value equal in magnitude to the number entered from the keyboard.
  4. The loop with precondition is executed: a) The value of the temporary variable is compared to zero. If its value is greater than zero, the loop continues executing; otherwise, it terminates. (Go to step 5) b) The temporary variable is divisible by 10. c) The digit counter variable is incremented by one.
  5. The entered number and the number of its digits are displayed on the screen.

NumOfDigits. ИС Visual Studio. Занятия по C. Простой Ввод/Вывод. Алгоритмы. Платформа Windows. Консольное приложение. Проект консольного приложения написан на языке программирования C и реализован в интегрированной среде Microsoft Visual Studio. Платформа Windows. Простой ввод-вывод. Определения количества цифр в числе, введённом с клавиатуры. Данная программа делает следующее:

  1. Запрашивает у пользователя ввод целого числа.
  2. Устанавливает счётчик количества цифр в значение равное нулю.
  3. Создаёт временную переменную с первоначальным положительным значением равным по модулю числу введённому с клавиатуры.
  4. Выполняется цикл с предусловием: a) Значение переменной сравнивается с нулём. Если оно больше нуля, цикл продолжает выполняться, в противном случае завершается (Переход к пункту 5). b) Времменая переменная делится на 10 c) Счётчик числа цифр увеличивается на 1.
  5. На экран выводится введённое число и количество цифр в нём.

About

NumOfDigits. C Tutorials. Microsoft Visual Studio IDE. Simple Input/Output. Algorithms. Console application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages