Write program using while loop to output squares of integers

Assignment Help Programming Languages
Reference no: EM1362640

Q1) Write a program that uses while loop to perform the following steps:

A. Prompt the user to input two integers: firstnum and secondnum. (firstnum must be less than secondnum)

B. Output all the odd numbers between firstnum and secondnum inclusive.

C. Output the sum of all the even numbers between firstnum and secondnum inclusive.

D. Output all the numbers and their squares between firstnum and secondnum inclusive.

E. Output the sum of the squares of all the odd numbers between firstnum and secondnum inclusive.

F. Output all the prime numbers between firstnum and secondnum inclusive.

Reference no: EM1362640

Questions Cloud

Calculate the abnormal return behavior : Aerotech, an aerospace-technology research Corporation, announced this morning that it has hired the world's most knowledgeable and prolific space researchers.
Determining projected ending retained earning balance : What is the projected ending retained earning balance of march 31, 2012, assuming that 2010 was their worst year of business?
Nutritional needs at an infant stage : What are the nutritional needs at an infant stage in life?
Allocate resources to high-return activities : The extent to which an organization has a coherent form for dividing labor, allocating responsibilities, coordinating tasks, and ensuring accountability.
Write program using while loop to output squares of integers : Write a program that uses while loop to perform the following steps:Output the sum of all the even numbers between firstnum and secondnum inclusive. Output all the numbers and their squares between firstnum and secondnum inclusive.
Compute implicit cost of demand deposits : A financial intermediation has estimated the following annual costs for its demand deposits: management expenses per account = $140, average account size = $1,500,
Plantwide versus department overhead rates : Suppose that instead of using a plantwide overhead rate, the company had used a separate predetermined overhead rate in each department. Under these conditions:
Address a rude and unprofessional instructor : Explain what is forward integration as it relates to strategic management and what are the advantages and disadvantages of it?
The market semi strong form efficient : Investors expect a corporation to announce a 10% increase in earnings, but instead the firm announces a 1% increase. If the market is semistrong-form efficient,

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a multi-threaded competition

Create a multi-threaded competition in which opposing Robin Hoods will attack one another and try to take each other's gold coins.

  Creating application to test class rectangle

Write down application to test class Rectangle.

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

  Application to inputs five numbers given between a range

Write an application that inputs five numbers, each between 10 and 100, inclusive. As each number is read, display it only if it's not a duplicate of a number already read.

  Program to calculate the electricity bill

Write a program to calculate the electricity bill. The rates of electricity per unit are as follows: If the units consumed are equal or less than 100, then the cost is Rs 8/- per unit.

  Basics of hypertext markup language

The basics of Hypertext Markup Language and World Wide Web.

  Values of variables of logical section of the pseudocode

What are the values of variables a, b, and c after each line of code of each logical section of the pseudocode. Show why the logical section is running.

  Create class to include fields for length-width in inches

Create a class name Tape that includes fields for length and width in inches and properties for each field. Also include a ToString () method that returns a string constructed from the return value

  Determine total cost of order-display it in alert dialog box

After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box.

  Write a method to accepts string as parameter

Write a method called wordCount that accepts a String as its parameter and returns the number of words in the String. A word is a sequence of one or more nonspace characters

  Sql query to retrieve data

Write SQL query to retrieve data from COURSE table for courses.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd