Computer Science, asked by useejdkdisowwlsm, 2 months ago

write a program to take 2 numbers as input and display all the natural numbers in that range use while... wend loop​


krrish4643: the answer is python program

Answers

Answered by BrainlyProgrammer
8

This is a very easy Question....Here is the answer

Program :-

CLS

PRINT "ENTER TWO LIMITS"

INPUT A,B

IF A>B

X=B

Y=A

ENDIF

ELSE

X=A

Y=B

ENDIF

PRINT "NATURAL NUMBERS BETWEEN THE RANGES ARE:-"

WHILE X<=Y

PRINT X

X=X+1

WEND

END

Variable Description:-

  • A & B:- to accept the number
  • X & Y :- To make copy of A &B

Explaination:-

  1. The program accepts two numbers as Input
  2. Then the copy of two numbers is made in X and Y such that X is less than or equal to Y
  3. While loop runs from X to Y
  4. X gets displayed and is updated with +1
  5. If X becomes greater than Y ...loop terminates
  6. Program ends :)

anindyaadhikari13: Nice answer.
BrainlyProgrammer: thanks!!
Similar questions