7 Discussion / Question Topics
Remove Filter
|
|
pretty new to programming in assembly but my assignment is to write a GCD program but my program works sometimes and sometimes it doesn't work. if i put the smaller number first then the larger number i don't get the correct GCD but if i do the opposite i get … |
|
[CODE]#include<stdio.h> int main() { int a,b,c; (printf("\nEnter 2 no.s"))?(scanf("%d%d",&a,&b))?(c=(a>b)?a:b):0:0; while(c>=1) {if(a%c==0 && b%c==0) {printf("\nGCD:%d",c);return 0;} c--; } }[/CODE] |
|
hey guys I'm a newb to this C++ programming and I need help. I've made a non-recursive GCD C++ code, but i was having problems with the algorithm. Can someone help please? [ICODE]import java.util.Scanner; public class GCD { public static int GCD; public static int div; public static int remainder … |
|
Hello, I am trying to write a algoritm that calculates the second largest divisor of a number. But i have absolutely no idea what calculations are required for this. [CODE] for (ulong i = 1; i < Number; i++) { Number = .....? }[/CODE] Already know the largest common diviser … |
|
[CODE]please help me in doing my project in one of my subject in college. it is all about getting the GCD of fractions... can anyone tell me the logic or the formula for getting it? tnxx in advance[/CODE] |
|
please help know how to get the GCD of fractions... i'm stuck in program because of this... any suggestions will do. tnx |
|
Hello, I have this program that simplifies a fraction by calculating the greatest common divisor. So the fraction 8/4 (largest common divisor = 4) 8/4 4/4 => result would be 2/1 (fraction simplified) My problem is my method calculated this greatest common divisor. But now that value has to be … |
The End.