Code Scrappers


Display 1-10 Numbers Without Using Conditional Loops - C Program


              #include<stdio.h>
              #include<stdlib.h>

              void main()
              {
                    Display(1);
              }

              int Display(int v)
              {
                    int i;

                    printf("%d\n", v);

                    i = v + 1;

                    if(i > 10)
                    {
                        return;
                    }

                    Display(i);
              }

          



Output

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10