12-12-2010, 12:07 AM
|
#976
|
تاريخ التسجيل: Apr 2010
التخصص: IT
نوع الدراسة: إنتظام
المستوى: الخامس
الجنس: ذكر
المشاركات: 29
|
رد: [cpcs 202 - برمجة 1] لديك سؤال , شيء غير مفهوم ,,, تفضل هنا , موضوع مفيد
السلام عليكم
بلييييييز أحد يشوف دا الشي ،، نفسي أعرف اش المشكلة   
حايسة فيه ويريت يشتغل بس عال قلبي ..
كود PHP:
#include <math.h> #include <conio.h> double Hypotenuse (double a, b) { double result; result = sqrt(pow(a,2)+(b,2)); return result; } double Area (double a, b) { double result; result = (a + b)/2; return result; } int main(void) { double hypotenuse, area, a, b; printf(" Please Enter a :"); scanf("%lf", &a); printf(" Please Enter b :"); scanf("%f", &b); Hypotenuse = Hypotenuse (a, b); Area = Area (double a, b); printf(" Hypotenuse : \n"); printf("%f\n", Hypotenuse); printf(" Area : \n"); printf("%f\n", Area); return(0); }
وشكراً جزيلاً :) ..
|
أختي ان شاء الله هذا هو الحل الصحيح
كود:
#include<stdio.h>
#include<math.h>
double triangle_hypotenuse(double a)
{
double result;
result = sqrt(pow(a,2)+pow(a,2));
return (result);
}
double triangle_area(double a)
{
double result;
result = (a*a)/2;
return (result);
}
int main (void)
{
double hypot;
double a;
double b;
double area;
printf("please enter the the leangth of the first rib : ");
scanf("%lf",&a);
printf("please enter the the leangth of the second rib : ");
scanf("%lf",&b);
hypot = triangle_hypotenuse(a);
area = triangle_area(a);
printf("the hypotenuse of the tringle is : %f\n",hypot);
printf("the area of the tringle is : %f",area);
return (0);
}
|
|
|
|
|