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
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:-
- The program accepts two numbers as Input
- Then the copy of two numbers is made in X and Y such that X is less than or equal to Y
- While loop runs from X to Y
- X gets displayed and is updated with +1
- If X becomes greater than Y ...loop terminates
- Program ends :)
Similar questions
Biology,
1 month ago
Social Sciences,
1 month ago
Hindi,
1 month ago
Social Sciences,
2 months ago
Social Sciences,
2 months ago
Science,
8 months ago
Physics,
8 months ago