Program to find GCD of two numbers in 'C' language.

//Simple Program To Find GCD of two numbers#include<stdio.h> int gcdd(int a,int b);int main(){int a,b;int ans;printf("Enter any two numbers.... ");scanf("%d %d",&a,&b);ans=gcdd(a,b);printf("GCD =>> %d",ans);}int gcdd(a, b){int t;while (b != 0){t = b;b =a % b;a = t;};return a;}

 
Output:

Comments

Popular posts from this blog

MATLAB code for Circular Convolution using Matrix method

Positive number pipe in angular 2+