You are not logged in. Please login at www.codechef.com to post your questions!

×

what is wrong??HCF and LCM

include<iostream>

using namespace std; int main() { int t; scanf("%d",&t); while(t--){ int a,b; scanf("%d %d",&a,&b); int hf; long long lc=(long long)a*b; while(b!=0){ int t=b; b=a%b; a=t; } hf=a; lc=(lc/hf); cout<<hf<<" "<<lc; }

return 0;

}

asked 16 Dec '18, 03:56

ritik1137's gravatar image

2★ritik1137
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×846

question asked: 16 Dec '18, 03:56

question was seen: 272 times

last updated: 16 Dec '18, 03:56