Adding two Integer number using Function.
/* Adding two
Integer number using Function.*/
#include <stdio.h>
int sum( int
x, int y); /* function prototype */
int sub( int
x, int y);
int mul( int
x, int y);
int div( int
x, int y);
/* function main begins program execution */
void main( )
{
sum (5,7);
sub (10,5);
mul (10,5);
div (10,5);
} /* end main */
/* Function
maximum definition */
/* x, y and z
are parameters */
int sum( int
x, int y)
{
printf ("%d", x+y);
getch();
} /* end
function maximum */
int sub( int
x, int y)
{
printf ("%d", x-y);
getch();
}
int mul( int
x, int y)
{
printf ("%d", x*y);
getch();
}
int div( int
x, int y)
{
printf ("%d", x/y);
getch();
}
|
Output:
|
Comments
Post a Comment