home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
multiply.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
603b
|
25 lines
/* Program to calculate the product of two numbers. */
#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: ");
scanf("%d", &a);
/* 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 ("\n%d times %d = %d", a, b, c);
}
/* Function returns the product of its two arguments */
int product(int x, int y)
{
return (x * y);
}