Horje
c++ program to find gcd of 3 numbers Code Example
c++ program to find gcd of 3 numbers
#include<stdio.h>
int main() {    
  int a,b,c,hcf,st;
  printf("Enter three numbers : ");
  scanf("%d,%d,%d", &a,&b,&c);
  st=a<b?(a<c?a:c):(b<c?b:c);
  for (hcf=st;hcf>=1;hcf--) 	{  	  
    if (a%hcf==0 && b%hcf==0 && c%hcf==0)
      break;
  }
  printf("%d",hcf); return 0;
}




Cpp

Related
float in c++ Code Example float in c++ Code Example
heap allocated array in c ++ Code Example heap allocated array in c ++ Code Example
sum of first 100 natural numbers Code Example sum of first 100 natural numbers Code Example
inheritance example in C plus plus Code Example inheritance example in C plus plus Code Example
files c++ Code Example files c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9