/* * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 * Repo: https://github.com/notamitgamer/bsc * License: MIT */ /* Write a program to generate all Pythagorean Triplets with slide length less than or equal to 30. */ /* Let Us C, Chap- 6, Page - 106, Qn No.: B(e) */ #include #include int main() { int a, b, c; printf("Pythagorean Triplets with slide length less than or equal to 30 : \n"); for (a = 1; a <= 30; a++) { for (b = a; b <= 30; b++) { int c_square = a * a + b * b; for (c = b + 1; c <= 30; c++) { if (c * c == c_square) printf("(%d, %d, %d)\n", a, b, c); } } } return 0; }