C Program to find GCD of two numbers
#include<stdio.h>int main(){
int a,b,i,gcd=1;
printf("Enter any two Number");
scanf("%d%d",&a,&b);
for(i=1;i<=a||i<=b;i++){
if(a%i==0&&b%i==0)
gcd=i;
}
printf("GCD=%d of %d and %d",gcd,a,b);
return 0;
}
All Programming Codes, Tech News, Latest Technologies, How-to-Tips. Programming Codex is Solutions for Smart Programmer.
#include<stdio.h>
int main(){int n;
int i=2;
scanf("%d",&n);
while(i<=n/2)
{
if(n%i==0)
printf("%d,",i);
i++;
}
return 0;
}