This is especially for the First Year Students in College of Engineering, Guindy.
I have solved some of the programs with easier Solutions..
Hoping Everybody could Understand Easier..
Doubts can also be posted in the comments section..
C Program to find the GCD of the given two numbers using Iteration..
#include<stdio.h>
int gcd(int a,int b)
{
int t;
while(b!=0)
{
t=b;
b=a%b;
a=t;
}
return a;
}
void main()
{
int x,y;
printf("Enter any two numbers..");
scanf("%d%d",&x,&y);
printf("\nThe gcd of the given two number is..%d",gcd(x,y));
}
No comments:
Post a Comment