The following program has careless errors on several lines. Find and correct the errors and show the
Question:
The following program has careless errors on several lines. Find and correct the errors and show the output where requested.
Transcribed Image Text:
#include int main () { } int* ptr: int* temp; int x; ptr = new int; *ptr = 4; *temp = *ptr; cout < < ptr X = 9; *temp = X; cout < < *ptr < < *temp; < < temp; ptr= new int; ptr = 5; cout < < *ptr < < *temp; // output: return 0;
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (1 review)
It appears that there are several mistakes in the C code snippet provided in the image Lets correct ...View the full answer
Answered By
Nazrin Ziad
I am a post graduate in Zoology with specialization in Entomology.I also have a Bachelor degree in Education.I posess more than 10 years of teaching as well as tutoring experience.I have done a project on histopathological analysis on alcohol treated liver of Albino Mice.
I can deal with every field under Biology from basic to advanced level.I can also guide you for your project works related to biological subjects other than tutoring.You can also seek my help for cracking competitive exams with biology as one of the subjects.
3.30+
2+ Reviews
10+ Question Solved
Related Book For
C++ Plus Data Structures
ISBN: 9781284089189
6th Edition
Authors: Nell Dale, Chip Weems, Tim Richards
Question Posted:
Students also viewed these Computer science questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
How many bracketings of length 2n will there now be? 1 [TURN OVER CST.93.2.2 2 Two teams A and B play a match in which the winner is the first team to win n games. If A needs i games to win and B...
-
Skip to main content Lab 11: A Web Server The goal of this lab is to write a simple, but functional, web server that is capable of sending files to a web browser on request. The web server must...
-
What is a derivative contract? Give an example. How are derivatives related to risk management?
-
In prewar days there was a controversy, perhaps apocryphal, about whether the bumblebee has a legitimate aerodynamic right to fly. The average bumblebee (Bombus terrestris) weighs 0.88 g, with a wing...
-
17.29 (Appendix C) How could a CPA firm use a sales-mix variance to analyze its revenue?
-
What percentage of IQ scores for rural Midwest seventh-graders are less than 100?
-
a. Firm D has net income of $83,700, sales of $2,790,000, and average total assets of $1,395,000. Calculate the firms margin, turnover, and ROI. b. Firm E has net income of $150,000, sales of...
-
Bed & Bath, a retailing company, has two departments Hardware and Linens. The company s most recent monthly contribution format income statement follows: Total Department Hardware Linens Sales $ 4 ,...
-
The three forces are applied to the bracket. Determine the range of values for the magnitude of force P so that the resultant of the three forces does not exceed 2400 N. 3000 N 90%- Prob. 2-38 800 N...
-
Read the code segment and fill in blank #20. 1. NULL 2. True 3. false 4. listData 5. answer not shown 4 Class Unsorted Type { public: //all the prototypes go here. private: int length; Node Type*...
-
Based on the following declarations, tell whether each statement below is syntactically legal (yes) or illegal (no). int* p; int* q; int* r; int a; int b; int c; int* p; int* q: int* r; int a; int b;...
-
What could the managers do to make the meetings more productive?
-
Noeleen AutoMall, Ltd. recently completed an initial public offering(IPO) for$23,000,000 by listing its common shares on the New York Stock Exchange. Prior to itsIPO, Noeleen was a privately held...
-
Process Costing- increased units, FIFO method Answer in good form 25 26 Illustrative Problem-Cost of Production Report using Treatment by Neglect Dept 1-100% of materials are added at the beginning....
-
Write a C++ program that prompts the user to enter a letter and encrypt it using the following method: if the letter is an upper-case letter the program replaces the letter by the 7th letter in the...
-
Turn this information into an excel sheets with the excel formulas being shown P12.4 (LO 1) (Payroll Tax Entries) The following is a payroll sheet for Otis Imports for the month of September 2025....
-
What is the major factor preventing women of the Indian diaspora from engaging in elaborate rituals? Group of answer choices Lack of motivation or devotion Because rituals are tied to a place and...
-
What factors could lead to capital market segmentation?
-
Discuss the information available from the following techniques in the analysis of inorganic pigments used in antique oil paintings: (i) Powder X-ray diffraction, (ii) Infrared and Raman...
-
Consider two different implementations of the same instruction set architecture. Th e instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate...
-
Consider three diff erent processors P1, P2, and P3 executing the same instruction set. P1 has a 3 GHz clock rate and a CPI of 1.5. P2 has a 2.5 GHz clock rate and a CPI of 1.0. P3 has a 4.0 GHz...
-
Assume a color display using 8 bits for each of the primary colors (red, green, blue) per pixel and a frame size of 1280 1024. a. What is the minimum size in bytes of the frame buff er to store a...
-
7 . 4 3 Buy - side vs . sell - side analysts' earnings forecasts. Refer to the Financial Analysts Journal ( July / August 2 0 0 8 ) study of earnings forecasts of buy - side and sell - side analysts,...
-
Bond P is a premium bond with a coupon of 8.6 percent , a YTM of 7.35 percent, and 15 years to maturity. Bond D is a discount bond with a coupon of 8.6 percent, a YTM of 10.35 percent, and also 15...
-
QUESTION 2 (25 MARKS) The draft financial statements of Sirius Bhd, Vega Bhd, Rigel Bhd and Capella for the year ended 31 December 2018 are as follows: Statement of Profit or Loss for the year ended...
Study smarter with the SolutionInn App