who can help me this

This is a discussion on who can help me this within the C++ Programming forums, part of the General Programming Boards category; #include <stdio.h> #include <conio.h> main() { float cost, price, budget; float apple_cot, orange_cost,papaya_cost; in apple, orange, papaya; char good bad; ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    1

    who can help me this

    #include <stdio.h>
    #include <conio.h>



    main()
    {
    float cost, price, budget;
    float apple_cot, orange_cost,papaya_cost;
    in apple, orange, papaya;
    char good bad;


    printf("Please enter cost ofone apple = ")
    scanf("%f",&apple_cost);

    printf("How many apples are there? = );
    scanf("d",&apple);

    printf("Total price of apples = %.2f",apple_cost*apple);


    printf("\nPlease enter cost ofone orange = ");
    scanf("%f",orange_cost);

    printf(How many apples are there? = ");
    scaf("%d",&orange);

    printf("Total price of oranges = %.2f",orange_cost*orange);




    getch();




    return(0);

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    First of all, use code tags. Second of all, what do you need help with? I mean, I can spot a few errors, but what is it you actually need help with?

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Mmm, it looks like "tutor" code with a number of deliberate errors which the student is supposed to fix.

    Except the "student" hasn't bothered with that step, and just found a forum to dump the code on hoping for quick and easy answer on a plate.

    Random characters deleted just to make you think, and throw up a few compiler errors.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by Salem View Post
    Mmm, it looks like "tutor" code with a number of deliberate errors which the student is supposed to fix.

    Except the "student" hasn't bothered with that step, and just found a forum to dump the code on hoping for quick and easy answer on a plate.

    Random characters deleted just to make you think, and throw up a few compiler errors.
    My thoughts exactly.

  6. #6
    Registered User
    Join Date
    Oct 2010
    Posts
    107
    Code:
    All of us can help you, but nobody will. Try putting it into gcc and see what compile errors you get. 
    The more compile errors you fix over time, the better you will become at solving your own problems
    rather than asking others to hand you solutions.

Popular pages Recent additions subscribe to a feed

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21