1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Where is the simple error?

Discussion in 'C' started by cquestion, Dec 5, 2007.

Thread Status:
Not open for further replies.
  1. cquestion

    cquestion New Member

    Hello, i'm going mad because I can't find the problem in this simple code. Why do this don't work?
    Code:
    float promedi(a,b)
    {
    return ((a+b)/2);
    }
    
    main()
    {
    float x,y;
    printf("Dame dos valores\n");
    scanf("%f%f", &x, &y);
    printf("%f",promedi(x,y));
    system("pause");
    }
    
    I got at least two different errors (strange long number solutions, window must close...).

    Thanks in advance.
     
    Last edited by a moderator: Dec 6, 2007
  2. cquestion

    cquestion New Member

    When it says 'Dame dos valores' it means tell me two numbers.
     
  3. shabbir

    shabbir Administrator Staff Member

Thread Status:
Not open for further replies.

Share This Page