Page 150 - Computer - 6
P. 150
Example 4: Write a program to accept a number from the user and display its table.
The code and sample output for the example are given below.
Example 5: Write a program to print the given series of numbers – 5, 8, 11, 14, 17, … upto 10 terms.
The code and sample output for the example are given below.
Example 6: Write a program to accept a number from the user. The program should display all even
numbers 1 to the entered number, and the sum of the displayed numbers.
The code and sample output for the example are given below.
Try This
Computational Skills
Write the code for the following programs in Small Basic.
1. Write a program to accept the length and breadth of a rectangle from the user and display its area and
perimeter.
2. Write a program to accept a number from the user and check whether it is divisible by 11 or not
(Hint: Use Remainder function)
3. Write a program to input a temperature in Celsius and convert it to corresponding temperature in
Fahrenheit. (Hint: Fahrenheit = 9/5 × Celsius + 32)
4. Write a program to print even numbers from 1 to 20 in separate lines.
5. Write a program to display the series 2, 5, 8, 11, … upto 15 terms.
6. Write a program to print the square and cube of numbers from 1 to 10.
(Square of a number = Number × Number
Cube of a number = Number × Number × Number)
148