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");
}
|
Go4Expert Member
|
|
| 6Dec2007,04:45 | #1 |
|
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");
}
Last edited by shabbir; 6Dec2007 at 09:43.. Reason: Code block |
|
Go4Expert Founder
|
![]() |
| 6Dec2007,09:45 | #2 |
|
float promedi(a,b) is not the right way of defining the function. it should be float promedi(float a, float b)
|
|
Go4Expert Member
|
|
| 7Dec2007,05:16 | #3 |
|
Hello shabbir. Thanks a lot for your help
. I'm sorry, I created two posts by mistake.
|
|
Go4Expert Founder
|
![]() |
| 7Dec2007,09:08 | #4 |
|
Quote:
Originally Posted by cquestion |