Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
U

User 10054935

@User 10054935
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • beginner question... recursive function
    U User 10054935

    Thanks to all! :) I understood!

    C / C++ / MFC question learning

  • beginner question... recursive function
    U User 10054935

    i have this code and it works fine.

    int fatt(int n)
    {
    int fattoriale = 1;

    if(n==0)
        return fattoriale;
    else
        return fattoriale=n\*fatt(n-1);
    

    }

    void main(void)
    {
    printf("%d\n",fatt(10));

    fflush(stdin);
    getchar();
    

    }

    my question is why it works fine also here ?

    int fatt(int n)
    {
    int fattoriale = 1;

    if(n==0)
        return fattoriale;
    else
        fattoriale=n\*fatt(n-1);
    

    }

    void main(void)
    {
    printf("%d\n",fatt(10));

    fflush(stdin);
    getchar();
    

    }

    in this, there aren't the return in the else.... i am using VS2010 and compile in .c . thanks ps: sorry for my english

    C / C++ / MFC question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups