answersLogoWhite

0

To find the ratio of x and y, the formula is x/GCD(x,y) : y/GCD(x,y).

#include<stdio.h>

#include<conio.h>

int gcdrec(int ,int);

void main()

{

int x,y;

clrscr();

scanf("%d %d",&x,&y);

printf("Ratio = %d:%d",x/gcdrec(x,y),y/gcdrec(x,y));

getch();

}

int gcdrec(int a , int b)

{

return(b!=0 ? gcdrec(b,a%b) :a);

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

Halstead's Software Science?

Halstead proposed the first analytic laws for computer science by using a set of primitive measures. these can be derived once the design phase is complected and the code is generated. these measures are listed below * n1= number of distinct operators in a program * n2= number of distinct operands in a program * N1= total numbers of operators * N2= total number of operandsBy using these measures,Halstead developed an expression for overall program length,program volume,program difficulty,development effort and so on.Program length (N) can be calculated by using equation:N = n1log2 n1 + n2log2 n2Program volume (V) can be calculated by using equation:V = N log2(n1+n2)Note that the program volume depends on the programming language used and respesents the volume of information (in bits) required to specify a program.Volume ratio (L) can be calculated by using the following equation:---- volume of the actual programWhere value of L must be less than 1. Volume ratio can be also calculated byProgram difficulty level (D) and effort(E) can be calculated by equations: D = (n1/2)*(N2/n2) E = D * V


Why do you have high level programming language?

High level programming languages offer a very high ratio of machine instructions over language expressions. In other words, a few high language statements can accomplish a lot, allowing the programmer to focus on solving the specific application's problem rather than reinventing the proverbial wheel or spending time with software engineering housekeeping duties.


What is voltage transformation ratio?

ratio of secondry voltage to primary voltage is called voltage transformation ratio


What is the standard ratio for inventory turnover ratio?

five


What range of values does intrinsic standoff ratio fall into?

The ratio of RB1 to RBBO is the intrinsic standoff ratio. It is the standoff voltage ratio to the power supply voltage.

Related Questions

Numbers that can be expressed as a ratio are called?

Rational numbers. write a ratio to express the number of people who preferred wanr to those who preferred wclm


Why you cannot write irrational numbers in fraction?

Because that is the definition of irrational numbers: They are the numbers that cannot be written as a ratio of two integers! A fraction is a ratio of two integers.


How can you Write 0.272727 as a ratio of two whole numbers?

3/11


How do you write 200 of 150 in a ratio?

To write 200 of 150 in a ratio, you express it as 200:150. This can be simplified by dividing both numbers by their greatest common divisor, which is 50, resulting in a simplified ratio of 4:3. Therefore, the ratio of 200 to 150 is 4:3.


How do you write 28 to 42 as a ratio of whole numbers using fractional notation?

28/42


How do you write 5.9 to 100 as a ratio of whole numbers using fractional notation?

It is 59/1000.


What is the ratio of 51 and 36?

You can write this as 51:36.Note: You can simplify ratios the same way you simplify fractions; that is, if you find a number that is a factor of BOTH numbers, you can divide both numbers by that factor, to get an equivalent ratio.


Write the ratio of 282 to 54 in the lowest terms?

To write the ratio of 282 to 54 in lowest terms, we need to find the greatest common divisor (GCD) of the two numbers, which is 6. Then, we divide both numbers by the GCD to simplify the ratio. Therefore, the ratio of 282 to 54 in lowest terms is 47 to 9.


What do you call the numbers in a ratio?

the numbers in a ratio called TERMS


How do you write 50 to 45 as a ratio of whole numbers using fractional notation?

50 : 45 = 10/9


Is a ratio a comparison of 2 numbers?

a ratio is a comparison of 2 numbers


How do you write 3 tenths as an equivalent fraction?

3/10. Also, you can multiply both numbers of the ratio, 3/10, by any non-zero number. You will have an equivalent ratio.