Sail E0 Webinar
Question
Select the output for the following set of Code:
 static void Main(string[] args)  {      int n, r;      n = Convert.ToInt32(Console.ReadLine());      while (n > 0)      {          r = n % 10;          n = n / 10;          Console.WriteLine(+r);      }      Console.ReadLine();  } for n = 5432.
Options:
A .  3245
B .  2354
C .  2345
D .  5423
Answer: Option C


Reverse of number using while loop.
Output: 2345.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers