Thursday, January 20, 2011

Overview of C

This presents a very simple program that uses a mul() function.
#include< stdio.h >  
int mul (int a, int b);
void main ()
{
int a, b, c;
a = 5;
b = 10;
c = mul (a,b);
printf ("multiplication of %d and %d is %d",a,b,c);
getch();
}
int mul (int x, int y)
{
int p;
p = x*y;
return(p);
}

No comments:

Post a Comment