Question: I am a Beginner in Functions.I wanna integrate that Functions in my main program. The program should scan a int number and then square it(sum=b\*b). Then the program should output the result.

```
#include <stdio.h>
#include <stdlib.h>
void funktion(int);
void out(int);
int main(int)
{
int sum,b,v,w,z;
{
    funktion();
    calculator();
    out();
    printf("%i",sum);
}
return 0;
}

void funktion(int v)
{
printf("Enter any number that is to be squared!");
}
void calculator(int w) //calculate b*b
{
scanf("%i",&b);
sum=b*b;
}
void out(int z)
{
printf("Sum:");
}

```

Please give me some tips. ;)
Thx & Best regards!

Answer: 
Are you looking for this kind of solution: i just made little changes. you may need to do some initializing things if u gonna use this code

```
#include <stdio.h>
#include <stdlib.h>
void funktion(int);
void out(int);
int main()
{
int sum,b;
{
    printf("Enter any number that is to be squared!");  
    scanf("%i",&b);

    sum = funktion(b);
    out(sum);
}
return 0;
}

int funktion(int b)
{
    return b*b;
}
void out(int sum)
{
    printf("Sum:%d",sum);
}

```
```
void funktion(int)
{
printf("Enter any number that is to be squared!");
}
void out(int)
{
printf("Sum:");
}

```

to call these functions you are passing some value so you receive them with parameters.

```
void funktion(int a)
{
printf("Enter any number that is to be squared!");
}
void out(int b)
{
printf("Sum:");
}

```

You can make use of the passed value in functions using these variables, a nd b in corresponding functions.  

If you dont want to access those passed values in the called functins then you dont need to pass the value. So change the functions to receive nothing, it can be

```
#include <stdio.h>
#include <stdlib.h>
void funktion();
void out();
int main()
{
int sum,b;
{
    funktion();
    scanf("%i",&b);
    sum=b*b;
    out();
    printf("%i",sum);
}
return 0;
}

void funktion()
{
printf("Enter any number that is to be squared!");
}
void out()
{
printf("Sum:");
}

```

make the call to function without passing arguments. you can even specify `void` as type to indicate that function doesn't take any parameters.  

To calculate in other function and return the value use `return` statement.

```
int calculator() //calculate b*b
{
scanf("%i",&b);
sum=b*b;
 return sum;
}

```

change the function call statement to,

```
sum=calculator();

```