#include <stdio.h>
#include <conio.h>
int get_hcf(int a, int b)
{
  int l, i, hcf;
  if (> b) {
     l = a;
10    } else {
11       l = b;
12    }
13    for (= 2; i <= l; i++)
14    {
15      if (((% i)== 0) && ((% i) == 0))
16      {
17        hcf = i;
18      }
19    }
20    return hcf;
21  }
22 
23  int main(int argc, char *argv[])
24  {
25 
26    int a,b,hcf;
27    printf("\nEnter two numbers:");
28    scanf("%d %d", &a, &b);
29    hcf = get_hcf(a, b);
30    printf("\nHCF of %d and %d is: %d", a, b, hcf);
31 
32  }
33 

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

palindrome digits, upper and lower 16bit of 32bit unsigned, Exchange variables, prime number, HCF, LCM, Pascals triangle,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan