Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i need to know what this c code does.. please help me...

    #include <stdio.h>
    short int somatorio(short int x){
    if(x == 1)
    return x;
    else
    return x + somatorio(x – 1);
    }
    main(){
    int y;
    t = somatorio(50);
    }

    this is the c code that i dont know what it does, please help me. and thanks for all you time.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    It is a recursive function that is doing a summation.
    OracleGuy

  • #3
    New to the CF scene
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    related with the c code

    is there any way to convert this c code into the assembly code in the program MARIE? thaks for your time

  • #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by wizzard View Post
    is there any way to convert this c code into the assembly code in the program MARIE? thaks for your time
    Yes it is possible to write it in assembly. I don't know what MARIE is.
    OracleGuy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •