Posts

Showing posts from July, 2013

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

Image
//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: