recursive calls

Hey,
dear , i want to make following outputs... but using recursive calls..that i dont know..plz first tell me what is that recursive calls..and plz do following to make my concepts bright clear...
thanx...a lot.
***
****
*****
*****
****
***


once again thanx...

Comments

  • : Hey,
    : dear , i want to make following outputs... but using recursive calls..that i dont know..plz first tell me what is that recursive calls..and plz do following to make my concepts bright clear...
    : thanx...a lot.
    : ***
    : ****
    : *****
    : *****
    : ****
    : ***
    :
    :
    : once again thanx...
    :
    :


    #include

    void print_char(int count)
    {
    int i;
    for (i = 0; i < count; ++i)
    putchar('*');
    putchar('
    ');
    }

    void foo(int start, int max)
    {
    if (start <= max) {
    print_char(start);
    foo(start+1, max);
    print_char(start);
    }
    }



    int main()
    {
    int i, j;
    printf("Enter min and max: ");
    scanf("%d %d", &i, &j); // 3 and 5 for ur case
    foo(i, j);

    return 0;
    }


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion