Write a Fortran program that creates an integer array with values -123, -4, 5, 67, 890,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Fortran program that creates an integer array with values -123, -4, 5, 67, 890, and 12345. Prints out the array in several formatted ways. a. Print each element, on its own line, using a field that is 3 wide. b. Print each element, on its own line, using a field that is 4 wide. c. Print each element, on its own line, using a field that is 5 wide. d. e. Print each element, on its own line, using a field that is only as wide as needed. Print all six elements on one line, giving each a field that is 8 wide, using the repeat operator in your format statement. Be sure to understand why each number printed the way it did. Write a Fortran program that creates an integer array with values -123, -4, 5, 67, 890, and 12345. Prints out the array in several formatted ways. a. Print each element, on its own line, using a field that is 3 wide. b. Print each element, on its own line, using a field that is 4 wide. c. Print each element, on its own line, using a field that is 5 wide. d. e. Print each element, on its own line, using a field that is only as wide as needed. Print all six elements on one line, giving each a field that is 8 wide, using the repeat operator in your format statement. Be sure to understand why each number printed the way it did.
Expert Answer:
Answer rating: 100% (QA)
Here is the code for you Script to create an array with values 123 4 5 67 890 and 12345 array 123 4 5 67 890 12345 a Print each element on its own lin... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You are designing a new syntax for a programming language like Java, with the intention of making it more approachable to students by using English words instead of punctuation symbols. (a) How does...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
What is wrong with the following code fragment? int[] a; for (int i = 0; i < 10; i++) a[i] = i * i;
-
Find the requested value and identify each of the other values as the periodic rate, the number of periods, the principal, or the future value. 1. Find S: S = 2000(1 + 0.02)24 2. Find S: S = 15,000(1...
-
When is a company allowed to initially recognize the financial statement effects of a tax position?
-
What is protected visibility? Give an example.
-
Rajiv, Co., had inventory and accounts payable of $110,000 on December 31, 20X7. Data for 20X8 follow: Gross purchases on account .........$980,000 Cost of goods sold ............. 920,000 Inventory,...
-
Use the given graph to solve the following inequality. f(x)4 The solution set for f(x)4 is (Type your answer in interval notation.)
-
Figure E3.3 shows a pulse function,u(t). (a) From the information shown in Fig. 3.3, calculate the pulse width, t w . (b) Express u(t) as the sum of simpler functions (some perhaps translated in...
-
Good-Fit Garment Industry was established on July 01, 2018 who is manufacturing and marketing designer garments. After expiry of its first six months operations, the chief executive of the company...
-
Do you get a chance to review financial statements at your place of work? Would you like to? Why?
-
What is the first and foremost reason for developing a business plan?
-
Are you familiar with the current maturity of long-term debt? What example of it can you give in your own life (either at work or at home)?
-
What does workload refer to?
-
Can you think of good outside sources that could be used to obtain ratios for comparative purposes? If the outside information was available, what ratios would you choose to use? Why?
-
Cranest Manufacturing uses departmental cost driver rates to allocate manufacturing overhead costs to products. Cranest is in the process of bidding on two jobs: Job 500 an order of 15 standard...
-
Consider a game of poker being played with a standard 52-card deck (four suits, each of which has 13 different denominations of cards). At a certain point in the game, six cards have been exposed. Of...
-
Create the following matrix A. By writing one command and using the colon to address range of elements (do not type individual elements explicitly), use the matrix A to: (a) Create a six-element row...
-
The product of two consecutive integers is 6,972. Using MATLAB's built-in function for operations with polynomials, determine the two integers.
-
Consider the ellipse x2/192 + y2/52 = 1. Determine the sides a and b of the rectangle with the largest area that can be enclosed by the ellipse.
-
Give some examples of models in which the dependent variable is a count variable.
-
Explain why estimation of a supply and demand model requires an alternative to ordinary least squares (OLS).
-
Describe what is meant by the phrase "sample selection."
Study smarter with the SolutionInn App