...

View Full Version : i need to know what this c code does.. please help me...



wizzard
06-03-2009, 06:05 PM
#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.

oracleguy
06-03-2009, 09:53 PM
It is a recursive function that is doing a summation.

wizzard
06-04-2009, 04:33 PM
is there any way to convert this c code into the assembly code in the program MARIE? thaks for your time :)

oracleguy
06-04-2009, 05:01 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum