Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Implement a function to find the GCD of two numbers.

Medium

Problem Statement

Implement a function to find the GCD of two numbers.

Sample Input

36 60

Sample Output

GCD of 36 and 60 is 12

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <stdio.h> int gcd(int a, int b) { // Your code here } int main() { int a = 36, b = 60; printf("GCD of %d and %d is %d\n", a, b, gcd(a, b)); return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
36 60
Expected Output
GCD of 36 and 60 is 12