please help me! I'm using Turbo C v3.0
problem:
when I hit enter for the answer it doesn't give the product, the program closed.... :(
Expand|Select|Wrap|Line Numbers
- #include<stdio.h>
- int a, b, c;
- int product (int x, int y);
- main()
- {
- //input first number
- printf("enter a number between 1 and 100: ");
- scanf("%d", &a);
- //input second number
- printf("enter another number between 1 and 100: ");
- scanf("%d", &b);
- c = product(a, b);
- printf ("%d times %d = %d\n", a, b, c);
- return 0;
- }
- int product( int x, int y)
- {
- return (x * y);
- }