Explore BrainMass
Share

Explore BrainMass

    C program to compute profit in stocks

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    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].

    © BrainMass Inc. brainmass.com October 10, 2019, 3:26 am ad1c9bdddf
    https://brainmass.com/computer-science/arrays/c-program-to-compute-profit-in-stocks-419989

    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