الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

اول واجب .. حساب الدائرة

بدأه abdulrhman91 في 22 أكتوبر 2010 · 2 رد · 532 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

انا طالب في كلية الحاسب الالي لكن واجهتني مشاكل بأول واجب وحبيت انك تساعدني وادعي لك

اعطاني كود واراد ان اصححة

X4J47436.jpg

الكود

 #include <iostream>
using namespace std;
int main () {
float volume
float surface_area;
float h;
float r;
float Pi = 3.14;
cout << "Enter the height and the radius of the cone separated by comma ";
cin >> h, r
surface_area = Pi * r * s + Pi * r ;
volume = 1 / (3 * Pi * r * r * h) ;
cout << "The volume of the cone is ", volume;
cout << " and the surface area of the cone is ", surface_area;
return 0;

}

عجزت بكل الطرق تصحيحة يالليت تساعدني وتشرح لي الاغلاط

وشكرآ

#2

السلام عليكم ,

صححت لك الكود , وإذا فيه شي مب واضح أشرح لك إياه ..

#include <iostream>
#include <math.h>
using namespace std;
int main () {
float volume , surface_area , h , r ,s, Pi = 3.14 ;
cout << "Enter the height and the radius of the cone separated by comma :"<<endl;
cin >>h>>r;
s = sqrt((h*h)+(r*r));
surface_area = (Pi * r * s) + (Pi * r*r) ;
volume = (Pi * r * r * h)/3 ;
cout << "The volume of the cone is "<<volume;
cout << "\nand the surface area of the cone is "<<surface_area;
system("pause");
return 0;
}

بالتوفيق :happy: ,

تم تعديل هذه المشاركة بواسطة إشراقة فجر في 22 أكتوبر 2010 في 15:38

1

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#3

جزاك الله الف خير

مواضيع مشابهة