Monday, December 26, 2011
8:04 PM

C Program To Find LCM and HCF of a Number


Program to find LCM and HCF of a Number






#include
//declaration of lcm functionint lcm(int,int);
//declaration of hcf functionint hcf(int,int);
void main(){int d,a,b;printf("enter the two number whose lcm or hcf should be find :" );scanf("%d%d",&a,&b);printf( "the hcf of the numbers is:");d = hcf(a,b);printf("%d",d);printf( "\nthe lcm of the numbers is:");d = lcm(a,b);

0 comments:

Post a Comment