The document provides a SciLab program that takes user input for a lower and upper limit of positive integers, then displays all numbers within that range that contain the digit 2. The program defines a function to iterate from the lower to upper limit, displaying each number, and calls the function while prompting the user for input values for testing.
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
(SciLab) Write a program that displays all numbers between input param.docx
1. (SciLab) Write a program that displays all numbers between input parameters "lower_limit"
and "upper_limit" that have at least one digit equal to '2'. Note: "lower_limit" and
upper_limit" are positive integers.
I need to write this in SciLab, I'm new to computer science and am still learning how to use it.
Solution
//Write a program that displays all numbers between input parameters "lower_limit" and
"upper_limit"
function d=displaynum(lower_limit,upper_limit)//function define
for d =lower_limit:upper_limit //range of numbers
disp(d) //display
end
endfunction
x=input('Enter Lower_limit positive integer')//prompt for input values
Enter Lower_limit positive integer 1
x=1
y=input('Enter Upper_limit positive integer')
Enter Upper_limit positive integer 5
y=5
d=displaynum(x,y)
sample output
1
2
3
4
5