The oldest known trivial algorithm known:
int gdc (int x, int y){
int temp;
while (y!=0){
temp=y;
y=x%y;
x=temp;
}
return x;
}
Check the Wikipedia entry to read more about it.
Improve your writing skills in 5 minutes a day with the Daily Writing Tips email newsletter.
The oldest known trivial algorithm known:
int gdc (int x, int y){
int temp;
while (y!=0){
temp=y;
y=x%y;
x=temp;
}
return x;
}
Check the Wikipedia entry to read more about it.