Dinesh Rajput
Write a program to print 1 to 100 without using any types of loop and only have an entry point.
By Dinesh Rajput in .NET on Jul 17 2017
  • jamil shah
    Nov, 2017 24

    public static void PrintNext(i) {if (i <= 100) {Console.Write(i + " ");PrintNext(i + 1);} }public static void Main() {PrintNext(1); }

    • 1
  • Akintunde Christain
    Mar, 2018 13

    static void Main(string[] args){int i = 1;repeat:if (i < 101){Console.WriteLine(i);i++;goto repeat;}Console.Read(); }

    • 0
  • Dinesh Rajput
    Mar, 2018 8

    you have used a function.i don't want any function rather than Main() function.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS