Hello all, my latest assignment was to find the sum of 2 numbers using functions which I managed to do. I decided to try and get the multiplication tables of x up to 12 using functions. I get the error code: "undefined reference to xyz". XYZ is just a random name for the function. Any help would be greatly appreciated, thank you.
Code:
#include<stdio.h>#include<stdlib.h>
int xyz(int x);
int main()
{
int x,i;
printf("Enter the number for which you want a multipication table for: ");
scanf("%d",&x);
for (i=0;i<x;i++)
{
printf("%d*%d=%d",x,i,xyz(x));
}
int xyz(int x)
{
return x*i;
}
}