Ok I am trying to get this extremely simple code to work(it is in the book I am trying to use to learn C from) any ways my compiler says I have 12 errors!!
I know that is pathetic for something this small but it is my first program and I looked it over and I just can't find out what is wrong with it. Anyways here is the source code:
/* Program multiplies two numbers together and displays the results*/
#include <stdio.h>
int a,b,c;
int product(int x, int y);
main()
{
/* Input the first number */
printf("Enter a number between 1 and 100: ")
scan(%d", &b);
c=product(a,b);
printf ("%d times %d=%d\n", a,b,c);
/* Input the second number*/
printf("Enter another number between 1 and 100: ");
scanf("%d, &b);
/* Calculate and display the product */
c=product(a, b);
printf ("%d times %d = %d\n", a,b,
return 0;
}
/*Function returns the product of its two arguments */
int product(int x, int y)
{
return (x*y);
}
Keep in mind it isn't the book, I am trying not to just copy and paste(it is an e-book) because I want to get a feel for the language so that is where the mistakes come from. Please help.