7 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for newGains

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 …

0
155
Member Avatar for compzets

[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]

Member Avatar for thines01
0
167
Member Avatar for ronak127

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 …

Member Avatar for mrnutty
0
176
Member Avatar for Nerathas

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 …

Member Avatar for ddanbe
0
2K
Member Avatar for itiwcsingkaww

[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]

Member Avatar for nbaztec
0
189
Member Avatar for itiwcsingkaww

please help know how to get the GCD of fractions... i'm stuck in program because of this... any suggestions will do. tnx

Member Avatar for NicAx64
0
113
Member Avatar for Nerathas

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 …

Member Avatar for ddanbe
0
159

The End.