Learning C, trying to code a program that outputs the sum of the cube and square of an inputted number.
#include <stdio.h>
main()
{
int a;
scanf("%d",a);
printf("%d",cube(a)+sqr(a));
}
cube(int x)
{
return(x*x*x);
}
sqr(int arg)
{
return(arg*arg);
}
When I run the program it outputs some seemingly random string of numbers after I input a number. Any way to fix it without changing the usage of returns to assign variables?