Write a program to calculate the HCF of two number using recursive function
#include<stdio.h> #include<math.h> int hcf(int x, int y) { if(y==0) return x; else return hcf(y, x%y); } int main() { printf("HCF: %d",hcf(100,70)); return 0; }
Output
HCF: 10