Share
Explore BrainMass

C program to compute profit in stocks

Please assist with the following C program.

Six stock prices (buying price) are stored into a 2 x 6 two-dimensional array. The user inputs the current price of each stock. This program will compare the buying price and the current price of each stock. It will print a table like following:

Stock Buying Price Current Price Profit If Sold
1 12.25 15.00 2.75

After the table is displayed, print out the stock with the highest profit if sold and its position in the array[row][column].

Solution Preview

Attached implementation (419989.c) reads the buying and current prices of stocks from user in two separate loops, however it has comment that tells you what ...

Solution Summary

Attached implementation (419989.c) reads the buying and current prices of stocks from user in two separate loops, however it has comment that tells you what to do if you do not want to read buying prices from user. Implementation also introduces you to the usage of macro.

$2.19