C Program Sample Code
This blog contains C program sample code. One can use this free code.
Monday, May 23, 2016
How to find GCD of two numbers in C Language
Find GCD of two numbers in C Language
C Program for GCD of Two Numbers:
#include<stdio.h>
void main()
{
int x, y;
x = 12; y = 18;
while(x != y)
{
if(x > y)
x = x - y;
else
y = y - x;
}
printf("GCD of x and y is = %d", x);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment