Board logo

標題: I need your help [打印本頁]

作者: happy_holiday    時間: 2006-12-26 20:37     標題: I need your help

It is a C program for calculate area of rectangle.
Would you help me to test the program correct or not.
thx, I have tried, but the result is abnormal.
I feel happy if you  can help me solve this problem.
I am a newbie in Program C.

#include<stdio.h>
#include<stdlib.h>
int area(int);
int main(void)
{
    int l, w, result;
    printf("Enter length of rectangle.\n");
    scanf("%d",&l);
    printf("Enter width of rectangle.\n");
    scanf("%d",&w);
    printf("Area of the rectangle is %d\n", area(result));
    system("pause");
}
int area(int result)
{
     int l, w;
     result = l * w;
     return (result);
}
作者: happy_holiday    時間: 2006-12-27 19:40     標題: I have find the ans.

Thanks every one
作者: eth1235    時間: 2007-4-2 21:27

Thanks every one




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0