Results 1 to 1 of 1

Thread: problem in function call

  1. #1
    Join Date
    Jul 2012
    Location
    Ahmedabad, Gujarat, India
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question problem in function call

    Hello,

    Actually i am looking for fuction call for my client side but keep continuing problem with function call & i saw an error with C2059 "syntax error" when i made my programme.

    Code:
        #include <iostream>
        #include <cmath>
        #include <iomanip>
        using namespace std;
        int math (double cartons, double totalcost, double totalprofit, double milkprofit, double cost);
        int main()
        {
        int math;
        char cartons,totalcost,totalprofit,milkprofit,cost;
        math= cartons + totalcost + totalprofit + milkprofit + cost;
        return (0);
        }
        int math()
        {
        char ans = 'y';
        bool quad_answer = false;
        do
        {
        double LitersMilkProduce;
        double cartons, totalcost, totalprofit, milkprofit, cost;
        const double LITERCOST(0.37), CARTONPROFIT(0.27), LITERS_PER_CARTONS= (3.78);
        cout << "Enter the total number of liters: ";
        cin >> LitersMilkProduce;
        cartons = LitersMilkProduce / LITERS_PER_CARTONS;
        totalcost = LitersMilkProduce * LITERCOST;
        totalprofit = LITERCOST * CARTONPROFIT;
        cout << "The total number of liters = " << LitersMilkProduce << endl;
        cout << fixed << showpoint<< setprecision(2) <<fixed << "Amount of cartons = " << cartons <<endl;
        cout << "cost of milk is = ";
        cin >> LitersMilkProduce ;
        cost = LitersMilkProduce * LITERCOST;
        cout << "profit from milk is =";
        cin >> LitersMilkProduce;
        milkprofit = LitersMilkProduce * CARTONPROFIT;
        if (quad_answer) cout << endl;
        cout << "Continue (y/n)? ";
        cin >> ans;
        while (ans == 'y');
        }
        return 0;
        };
    looking for help kindly let me know about this.
    Last edited by jscheuer1; 10-02-2012 at 02:24 PM. Reason: Format

Similar Threads

  1. Function with URL call
    By dz.slick in forum JavaScript
    Replies: 14
    Last Post: 11-11-2011, 10:20 AM
  2. Interstitial Function Call
    By ACLLC in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-25-2010, 08:40 PM
  3. call second function after first
    By vineet in forum JavaScript
    Replies: 2
    Last Post: 12-31-2008, 03:59 PM
  4. Replies: 2
    Last Post: 08-02-2007, 06:19 AM
  5. AJAX call function
    By melvinoyh in forum JavaScript
    Replies: 23
    Last Post: 06-15-2006, 06:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •