Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть Reverse of any number | Problem solving c programming | PROBLEM NO 10

  • Coding Halt
  • 2020-05-05
  • 67
Reverse of any number | Problem solving c programming | PROBLEM NO 10
Reverse of any numberreverse of any number#reverse_of_any_number#reverse of any number#codinghalt#real_life_c_problems#c problems#C_programming#leetcode#coding
  • ok logo

Скачать Reverse of any number | Problem solving c programming | PROBLEM NO 10 бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно Reverse of any number | Problem solving c programming | PROBLEM NO 10 или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку Reverse of any number | Problem solving c programming | PROBLEM NO 10 бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео Reverse of any number | Problem solving c programming | PROBLEM NO 10

We will remove the last digit from our number and append it to the end of our reversed number variable until our original number is gone and the reversed number is complete.
Assuming that we have provided our algorithm an integer to work with,
Where number is a variable that originally contains our integer,
Where lastDigit is a variable that contains the last digit of number,
Where reverse is a variable representing the reverse of number.
Step 1 — Isolate the last digit in number
lastDigit = number % 10
The modulo operator (%) returns the remainder of a divison. In this case, we divide number by 10 and return the remainder. Consider the integer 1234. The tens column (30) is divided by 10 without remainder, the hundreds column (200) as well, and also the thousands column (1000). The remainder of the division will be 4 representing the ones column which could not be divided by 10. We now have the means to isolate the last digit of any integer. We save this in the variable lastDigit.
Step 2 — Append lastDigit to reverse
reverse = (reverse * 10) + lastDigit
We can start building the reversed number now by appending lastDigit onto the end of reverse. Remember that both of these variables are integers so we can not simply concatenate. We multiply reverse by 10 so that the ones column becomes the tens column, the tens column becomes the hundreds column, and so on. This also leaves us with a new ones column where we can add our lastDigit which we determined was 4 in our example.
reverse = (0 * 10) + 4
reverse = 4
We have successfully copied the last digit of number and appended it to reverse.
Step 3-Remove last digit from number
number = number / 10
Notice that number is still 1234, even though we have already used that 4 on the end. To remove the last digit from number we simply divide it by 10. This works because we are performing integer division which rounds results down to the nearest integer (ex. 244 / 10 = 24).
Iterate this process
while (number is grater than 0)
Repeat this process until number is reduced to zero and reverse is completed.
Thank you for watching
Keep coding
Keep learning
Reverse of any number
reverse of any number
#reverse_of_any_number
#reverse of any number
#codinghalt
#real_life_c_problems
#c problems
#C_programming
#leetcode
#coding

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]