Thread: Passing arguements to fucntion not working

  1. #1
    Registered User
    Join Date
    May 2019
    Posts
    26

    Question Passing arguements to fucntion not working

    hello friends,

    I just wonder why this is not working


    Code:
    #include <stdio.h>#include <stdlib.h>
    
    
    void converttodollar(float euro);//prototyping function
    
    
    int main()
    
    
    {
    float euroPrice1 = 1.00;
    void converttodollar(euroPrice1);
    return 0;
    }
    
    
    void converttodollar(float euro)
    {
        float usd = euro * 0.88;
        printf(" %.2f Euros - %.2f Usd \n",euro ,usd);
    
    
        return;
    }
    ok i got this working

    calling the function in a wrong way

    Code:
    #include <stdio.h>#include <stdlib.h>
    
    
    void converttodollar(float euro);//prototyping function
    
    
    int main()
    
    
    {
    float euroPrice1 = 1.00;
    converttodollar(euroPrice1);
    return 0;
    }
    
    
    void converttodollar(float euro)
    {
        float usd = euro * 1.37;
        printf("%.2f Euros - %.2f Usd \n",euro ,usd);
    
    
        return;
    }
    Last edited by sash_007; 06-21-2019 at 07:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. passing reference to fucntion
    By bazzano in forum C Programming
    Replies: 4
    Last Post: 09-15-2005, 05:36 AM
  2. Replies: 4
    Last Post: 05-08-2005, 10:12 AM
  3. Passing Class Array through Fucntion
    By Cris987 in forum C++ Programming
    Replies: 2
    Last Post: 03-07-2004, 07:17 PM
  4. Passing to FindFirstFile not working
    By mikie7boy in forum C++ Programming
    Replies: 1
    Last Post: 08-30-2003, 02:24 PM
  5. Working With Command Line Arguements
    By mart_man00 in forum C Programming
    Replies: 4
    Last Post: 08-03-2002, 04:31 PM

Tags for this Thread