推介:| 網頁寄存 | 網頁設計 | 開網店 | 電郵申請 | Wordpress Hosting | 外賣平台 | 英語課程推薦 | 風水屋 | 房間風水懷孕 | Timway Testimonial | Wedding Planner | Wedding MC |

發新話題
打印

I need your help

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);
}

TOP

I have find the ans.

Thanks every one

TOP

Thanks every one

TOP

發新話題


重要聲明:本討論區是以即時上載留言的方式運作,本網站對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。本討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。


Copyright 1997- Xocat. All Right Reserved.