Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
Question
Book Icon
Chapter 6, Problem 6E
Program Plan Intro

Program Plan:

  • Include required header files.
  • Declare the function “main ()”.
    • Declare required variables “var1”, “var2”, “var3”, and “i”.
    • Print the values of “var1”, and “var2”.
    • Loop from 0 through 13 using “for” loop.
      • Add the value of “var1” and “var2” and store it in a variable “var3”.
      • Assign the value of “var2” to “var1”.
      • Assign the value of “var3” to “var2”.
      • Print the value of “var3”.
    • Return the statement.

Blurred answer
Students have asked these similar questions
I have an array of the first 50 Fibonacci numbers in the picture. Your program should ask the user for a number between 5 and 21.  Using that input as a location in the array, with that location and the next three locations (for example base, base+1, base+2 and base+3) you will multiply the outer values, base and base+3, (the first and last of the four). Do the same for the inner values (base+1 and base+2 multiplied) and then double that value.   These two values form the two sides of a right triangle.  Now find the hypotenuse.  Remember the Pythagorean theorem, which says a2 + b2 = c2.  Our two sides are a and b, so we square each of them (remember a * a = a2, so just multiply each value by itself) and add them together.  That gives you c2. Now all you need do is take the square root of that sum.   Given that the sqrt method normally returns a floating-point value (a double), we must force it to return a long integer for us in this case, so use the following line (with your own…
This program will create an array of 12 random integers (between 1-9) and remove all numbers less than or equal to another randomly generated integer (between 1-9)There are four steps to accomplish this.a. Create and fill an array of random integers between 1-9. The array must be size 12.b. Generate a random integer between 1-9.c. Write the code that will create a new array of the integers in the given array but with the numbers less than or equal to your random number removed. For example, if you randomly generated  6 and the original array contains 1 8 9 4 4 7 2 2 5 8 4 7 your new array will contain 8 9 7 8 7d. Print the original array, the number generated, and the new array.i.e. The original array contained:1 8 9 4 4 7 2 2 5 8 4 7All numbers less than or equal to 4 to be removed.The new array contains:8 9 7 5 8 7*Keep in mind that because we are dealing with random numbers, it is possible that the random number you generate for numbers to be removed from the array is less than…
Using C++ Language Start with the provided code and understand what it is doing. We are interested in computing the maximum grade out of the 6 quiz scores for each student in class. Assume the maximum class size is 10, but we will ask the teacher how many students there are in the class. It cannot be more than 10. In the below program, we create a two-dimensional array with the number of rows equal to the number of students (one for each student) and 6 columns (one column for each quiz grade). code:  #include <iostream>using namespace std;const int COLS = 6;const int ROWS = 10;void computeMaximum (float grades[][COLS], int num, float maximum[]);void showArray(float array[], int size);int main(){    float grades[ROWS][COLS];    float maximum[ROWS];    int num;        cout<<"How many students in the class?";    cin>>num;        for (int row = 0; row < num; row++)    {        //enters 6 quiz grades for each student                for (int col = 0; row< COLS; col++)…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning