Use of Multi-Language (Coding): Add Two Fractions Test
Given four integers num1, den1, num2, and den2 representing the numerators and denominators of two fractions, the task is to find the sum of the two fractions and print the resulting fraction in the reduced form. The function addFraction() takes these four integers as input and performs the addition of the two fractions. The resulting fraction is then reduced to its simplest form using the gcd of the numerator and denominator. Finally, the reduced fraction is printed in the form of "numerator/denominator".
Chatgpt
Perplexity
Gemini
Grok
Claude







