Posts

Showing posts from May, 2023

Write a program to input length and width of a rectangle and display it. Your program would continue to take input for the length and width using a for loop unless valid input is not given. Further, you would use the ASCII characters to display the rectangle on the output screen.

Image
 

Write a program to find the octal equivalent of the entered number.

Image
 

Write a program to add first ten terms of the following series using a for loop: 1/1!+1/2!+1/3!+ ⋯.

Image
 

According to a study, the approximate level of intelligence of a person can be calculated using the following formula: i = 2 + ( y + 0.5 x ) Write a program, which will produce a table of values of i, y and x, where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5.

Image
 

Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.

Image
 

Write a program to enter an integer and determine and print whether the integer entered is prime number or composite number. A number is prime if it has exactly two divisors

Image
 

Write a program to print all the ASCII values and their equivalent characters using a while loop. The ASCII values vary from 0 to 255.

Image
 

Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153 = 13 + 53 + 33

Image
 

Write a program to display first 100 even numbers

Image
 

Write a program to display the Fibonacci series up to 20 terms. A series in which the next term is calculated by adding the previous two terms. For example, the following is a Fibonacci series: 1, 1, 2, 3, 5, 8, 13…………

Image
 

Write a program to find the sum of the following series up to 20 terms. 5, 8, 11, 14, 17………

Image
 

Write a program to input a number and to find and display its non-trivial divisors.

Image
 

Write a program to input base and power and calculate and display its result. For example, if base = 2 and power = 5, result = 32

Image
 

Write a program to input a number and display its table.

Image
 

Write a program to input a number, calculate its factorial and display it

Image
 

Write a program to input a number and display the number of asterisks corresponding to that number. For example, if number = 5, output = *****

Image
 

Write a program to calculate and display the result of the following sum, when number n is input: 1+2+3……….n.

Image
 

Write a program to display first ten natural numbers

Image
 

Write a program to print your name ten times

Image
 

Write a program using switch-case structure to input an integer between 1 and 100 and print the corresponding integer in alphabets. For example, if the user enters 32, the result should be “You entered thirty two.” You may also use some other selection structure along with the switch-case structure in order to embed the full functionality the question has required.

Image