Problem! Factorial and Multiples

Hey! Help me with this, i dont get it! i need to find the factorial and multiples up to a 100 of n. Just fix mistakes please! its in spanish

#include "stdio.h"
#include "conio.h"

int n,f,a;

int factorial (int a)

{
n=f;
for(a=n-1; a>0; a=a-1)
f=f*a;
}

{
return (float f*a);
}

int multiplicacion (int n)

{
for(a=1; a<11; a++)
f=n*a;
}

{
return (float f)
}

int main()
{

printf("Escribe el numero a trabajar");
scanf("%f",&n);
printf("El factorial es: %f",f);
printf("Los multiplos son: &f",f);
}
I recommend reading the tutorial there is a lot wrong with your program.
http://cplusplus.com/doc/tutorial/
http://cplusplus.com/files/tutorial.pdf

Just in case English is a problem:
Recomiendo leer el tutorial que hay mucho mal con su programa.
Can someone just fix it? I swear it is really urgent and important! Im seriously becoming frustrated!!!! Please!!!
Your returns are not in your functions and they are returning the wrong kind of data.
C++ does not have enough memory in any of its normal variables to hold 100! or anything remotely close.
Also your int n,f,a; line needs to be declared inside of your main function if you plan to use them.
If you want your functions that you declare before main to actually work you need to call them from main.
You will also have to pass the values of f and a to your functions so either add more arguments or use pointer type variables.
If you still have problems, post whatever code you come up with after fixing at least some of what I told you and I will look at it again.
1
2
3
{
    return (float f*a);
}


this should be inside the function factorial like this one

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
int factorial (int a)
{
    n=f;
    for(a=n-1; a>0; a=a-1)
    f=f*a;
    //insert return (float f*a)
   return (float f*a);
}

int multiplicacion (int n)
{
    for(a=1; a<11; a++)
    f=n*a;
    return (float f);
}


hope this helps.
by the way, I don't check your code at all, I just scan it then notice your mistake.
@pablorod: olredixsis fixed one of your problems now just change the return value from float to int and add the arguments to your functions for values of f and a also.
Topic archived. No new replies allowed.