1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
postnew [5]
2 years ago
5

How to find HCF and LCM of a number in Q Basic program?? ​

Computers and Technology
1 answer:
DerKrebs [107]2 years ago
3 0
CLS
INPUT "Enter the first number"; a
INPUT "Enter the second number"; b
m = a
n = b
WHILE a <> 0
r = b MOD a
b = a
a = r
WEND
l = (m * n) / b
PRINT "HCF is "; b
PRINT "LCM is "; l
You might be interested in
Problem 1 Calculating the tip when you go to a restaurant is not difficult, but your restaurant wants to suggest a tip according
DIA [1.3K]

Answer:

bill = float(input("Enter the bill amount: "))

rating = int(input("Choose a rating: 1 = Totally satisfied, 2 = Satisfied, 3 = Dissatisfied.: "))

if rating is 1:

   tip = bill * 0.2

elif rating is 2:

   tip = bill * 0.15

elif rating is 3:

   tip = bill * 0.1

print("The rating is: " + str(rating))

print("The tip is: $%.2f" % (tip))

Explanation:

*The code is in Python

- Ask the user for the <em>bill</em> and <em>rating</em>

- Depending on the <em>rating</em>, calculate the <em>tip</em> using <u>if else</u> statement i.e. If the rating is chosen as 1, calculate the tip by taking 20 percent of the bill.

- Print the <em>rating</em> and the <em>tip</em>

4 0
3 years ago
The default color scheme is called ____.
notsponge [240]
What program is this regarding?

If it's a Microsoft Office product, the default colour scheme is "office"
5 0
3 years ago
let m be a positive integer with n bit binary representation an-1 an-2 ... a1a0 with an-1=1 what are the smallest and largest va
Ahat [919]

Answer:

Explanation:

From the given information:

a_{n-1} , a_{n-2}...a_o in binary is:

a_{n-1}\times 2^{n-1}  + a_{n-2}}\times 2^{n-2}+ ...+a_o

So, the largest number posses all a_{n-1} , a_{n-2}...a_o  nonzero, however, the smallest number has a_{n-2} , a_{n-3}...a_o all zero.

∴

The largest = 11111. . .1 in n times and the smallest = 1000. . .0 in n -1 times

i.e.

(11111111...1)_2 = ( 1 \times 2^{n-1} + 1\times 2^{n-2} + ... + 1 )_{10}

= \dfrac{1(2^n-1)}{2-1}

\mathbf{=2^n -1}

(1000...0)_2 = (1 \times 2^{n-1} + 0 \times 2^{n-2} + 0 \times 2^{n-3} + ... + 0)_{10}

\mathbf {= 2 ^{n-1}}

Hence, the smallest value is \mathbf{2^{n-1}} and the largest value is \mathbf{2^{n}-1}

3 0
2 years ago
What are two ways you have already contributed to your personal human capital? Explain why
Dmitry [639]
I helped myself in good ways.
4 0
3 years ago
Read 2 more answers
What do secondary sources rely on for their analysis of events?
MariettaO [177]

Secondary sources are defined as <u>a form of document that includes information from another source to analyze an issue. </u>

When a researcher or writer wishes to cite a secondary source, it means they are using information from a primary source that is presented in another document which has cited it, <em>instead</em> of directly referring to the primary source.

Thus, it can be said that the best answer for the question above is (D) primary sources only, since secondary sources use this when analyzing the problem presented in their document.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Identify a factor that is unlikely to influence the length of time people wait in the lunch line.
    8·2 answers
  • What is the model for 2017 Ford Mustang v6
    15·1 answer
  • How to bypass a Lightspeed and Rocket Filter blocked website without being a admin and without downloading extensions? Must incl
    15·1 answer
  • Anyone wanna join zoo m???????​
    10·2 answers
  • Which two statements are true about algorithms?
    15·2 answers
  • Select the correct answer.
    13·2 answers
  • Most of the internal operations in a computer use hexagonal numbering true or false
    13·1 answer
  • 1. If we want define style for an unique element, then which css selector will
    14·1 answer
  • How do you stop getting emails from brainly saying "sarah from brainly has answered your question"
    10·1 answer
  • Why does python code generate fewer types of syntax errors than code in other programming languages?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!