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

  Initialize elements of array with even integers

declare an array called values of type unsigned int with 5 elements. Initialize the elements of the array with the even integers from 2 to 10.

  Write application that inputs five number

Use a one-dimensional array to solve the following problem: Write an application that inputs five numbers, each of which is between 10 and 100, inclusive.

  Javascript for metric conversions

Write a javascript that will assist the user with metric conversions. Your program should allow the user to specify the names of the units as strings.

  Program to print total balances forward and total withdrawal

At the end of report, print total balances forward, total deposits, total interest earned, total withdrawals and total final account balances.

  Create application consisted of three classes

Create an application comprised of three classes. The first class called Crayon represents one crayon of a particular color and length (height).

  Program to compute grade point average

Write a program that uses such a file to calculate your grade point average(GPA). A GPA is based on a scale from 5, where A is 4, B is 3, C is 2, D is 1 and F is 0.

  Program to divide string based on some delimiter string

StringTokenizer is a class in the java.util library that can divide a String based on some delimiter String (a delimiter is a separator). If the instruction StringTokener st = new StringTokenizer.

  General layout for a web-based source document

Suggest the general layout for web-based source document that prospective sellers could use to explain their antiques. Information must include the user ID, password, item, dimensions, origin, condition, and asking price.

  Explaining exception handling using program

Use exception handling appropriately. Use comments to illustrate the various concepts applied / utilized in the solution.

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Write implementation of counter class

Write the implementation (.cpp file) of the Counter class. Here is the full specification of the class: A data member counter of type int.

  Create a multi-threaded competition

Create a multi-threaded competition

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