Write a program to find the HCF and LCM of the given numbers using functions

Source Code

int fhcf(int a,int b)
  int l,i,hcf;
    if(a%i==0 && b%i==0)
  return hcf;
int flcm(int a,int b)
  int p=0,i,lcm;
    if(i%a==0 && i%b==0)
  return lcm;
int main (int argc, char *argv[])
  int a,b,hcf,lcm;
  printf("\nEnter two numbers:");
  scanf("%d %d",&a,&b);
  printf("\nHCF of %d and %d is: %d",a,b,hcf);
  printf("\nLCM of %d and %d is: %d",a,b,lcm);

Find More from our code collection
Armstrong number, binary number to a decimal number, bubble sort, decimal number to binary number, factorial of the given number factors, fibonacci numbers, HCF and LCM, matrix, mergesort, salary of the employee. palindrome, quadratic equation, star patterns, series etc. and much more...
#Return to Example Source Code