দুই সংখ্যা x এবং y দেওয়া আছে। আউটপুটে তাদের k-তম সাধারণ ফ্যাক্টর থাকবে।
Input: x=9 y=18 k=1 Output : k common factor = 2 Factors of 9 : 1, 3, 9 Factors of 18 : 1, 2, 3, 6, 9, 18 Greatest Common Factor : 9
অ্যালগরিদম
START Step 1 -: take input as x and y lets say 3 and 21 and k as 1 Step 2 -: declare start variables as int i,num,count=1 Step 3 -: IF xউদাহরণ
#include<stdio.h> int main() { int x = 3, y = 21, k = 1; // taking x and y as two number and k is limit for their common factor int i,num,count=1; if(xআউটপুট
যদি উপরের প্রোগ্রামটি রান করি তবে নিচের আউটপুট জেনারেট হবে।
their kth common factor is : 2