dosseva

EX1_ReverseNums

Apr 16th, 2021
755
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace EX1_
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num, temp, remainder, reverse = 0;
  10.             Console.Write("Въведете цяло число \n");
  11.             num = int.Parse(Console.ReadLine());
  12.             temp = num;
  13.  
  14.             while (num > 0)
  15.             {
  16.                 remainder = num % 10;
  17.                 reverse = reverse * 10 + remainder;
  18.                 num /= 10;
  19.             }
  20.  
  21.             Console.WriteLine($"Резултат = {temp + reverse}");
  22.         }
  23.     }
  24. }
  25.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×