Home / CSE MCQs / C#.Net MCQs :: Discussion

Discussion :: C#.Net MCQs

  1. 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.
  2. A.
    3245
    B.
    2354
    C.
    2345
    D.
    5423

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    Reverse of number using while loop. Output: 2345.


Be The First To Comment