write an algorithm to display a number from 1 to 10
Answers
Answered by
24
Answer:
Step 1: Start
Step 2: Initialize variable number as integer
number (n) = 1
Step 3: Read and print the value of number
Step 4: Repeat the step 3 until number < 10
4.1: number = number (n) + 1
Step 5: Stop
Answered by
2
The algorithm for the given problem is,
- START
- Include the Random module.
- Read a variable 'random'
- Store the random number from 1 to 10 by using the random module in the variable 'random'.
- Print the value in 'random'.
- End
In the above algorithm,
- The Random module is included to use its methods for generating a number from a given range.
- After that, the generated random number is stored in the variable 'random'.
- Finally, the number is printed as the desired result.
Similar questions
English,
6 months ago
Business Studies,
6 months ago
Social Sciences,
6 months ago
English,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago