Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

need help for c++ programing for getting lcm & gcd of 2 no.

OpenStudy (anonymous):

OpenStudy (anonymous):

while(a<=0||b<=0); see i dont understand this.. are the nos. -ve

OpenStudy (anonymous):

@Abhisar @ganeshie8 @Compassionate

OpenStudy (anonymous):

@Loser66 @littletinkpink @lizzyrockefeller @linn99123

OpenStudy (anonymous):

@lall

OpenStudy (anonymous):

@Destinymasha @Donblue22

OpenStudy (anonymous):

open it with notepad

OpenStudy (anonymous):

im looking at ur attachment gimmie a second

OpenStudy (anonymous):

for ur question yes those are nos.

OpenStudy (anonymous):

Can Someone Help Me With Some Questions Please Im New To This Site

OpenStudy (anonymous):

actualy post it in the question box please

OpenStudy (bibby):

``` is #include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b,m,n,rem,lcm,gcd,prod; do { cout<<"enter two +ve integers \n"; cin>>a>>b; } while(a<=0||b<=0); m=a; n=b; prod=a*b; while(n) { if(m%n==0) break; else { rem=m%n; m=n; n=rem; } } gcd=n; lcm=prod/gcd; cout<<"lcm is "<<lcm<<endl; cout<<"gcd is "<<gcd; getch(); } ``` the || is the logical or. while(a<=0||b<=0); translates to while(a is less than or equal to 0 OR b is less than or equal to 0) the or truth table looks like: \( \begin{array}{c|lcr} & \text{} \\ \hline 0 0 & 0 \\ 0 1 & 1 \\ 1 0 & 1 \\ 1 1 & 1 \end{array} \)

OpenStudy (anonymous):

You can learn c++ here: https://www.thenewboston.com/videos.php?cat=16 and you can get c++ help here: https://www.thenewboston.com/forum/

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!