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

  Function to count number of times the given number occured

Write a main function to input 20 integers in the range of 1 to 6. Write a function to count the number of times the numbers 2 and 5 occur. The function should declare static variables count2 and count5.

  Create a college course to display the course data

Create a CollegeCourse that does not include the lab fee. Then display the course data. Save the files as CollegeCourse.java, LabCourse.java, and UseCourse.java.

  Specific changes made for different countries-sites directed

Why were these specific changes made for different countries at whom the sites were directed? Is there anything else you would consider changing.

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Design pseudocode to enter names of two primary colors

Design a pseudocode program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than "red", "blue", or "yellow".

  Write program to compute and outputs the average gpa

Write a program that computes and outputs the average GPA for both female and male students. Format your results to two decimal places. Your program should use the functions.

  Program to processes the test data

Write a program that processes the test data. The output should be the student's ID, followed by the answers, followed by the test score, and followed by the test grade.

  Write bash script to copy file from one location to another

Write a bash script called mycopy that copies a file from one location to another. An example of running the script is given below.

  Creating a security policy by gathering information

Suppose mantle of a security consultant. You are asked to visit a client and gather information to develop a security policy for them.

  Unix systems administration

Unix Systems Administration

  Write program to reads student-s name together with score

Write a program that reads a student's name together with his or her test score. The program should then compute the average test score for each student.

  Computing first seven values of fibonacci number sequence

Write a program that uses a loop to compute the first seven values of the Fibonacci number sequence.

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