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

مبتدئ في لغة السي ++ولديه سؤال ايها الاكارم

مغلق
بدأه Challenger في 23 أكتوبر 2005 · 3 رد · 493 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

اسال الله ان تكونوا بخير ايها الاخوة والاخوات الاكارم

واشكركم في الحقيقة على المنتدى الذي طالما استفدت منه علميا وادبيا

انا مبتدئ في لغة السي ++

وبدأت في تمرين اولي

وهو على الرابط

http://drr.cc/11/2005ex1.pdf

وكتبت بعض الاكواد واعطت نتائج جيدة

في الاخير

بدأت البنشرة :wacko:

فما دريت هل استخدم

while

او if

او for

اتمنى منكم التعاون والافادة

وهذا ان شاء الله من الحرص طلب العلم وتبادل الخبرات من بين الاخوة

وفقكم الله

:)

هذا الحل اللي سويته

include <iostream.h>

int main ()


/*This programme is written by Prof.Challenger:) */
{cout<<"Enter your 1st number:";
float int1;
cin>> int1;
cout<<"Enter your 2nd number:";
float int2;
cin>> int2;
cout<<"Enter your 3rd number:";
float int3;
cin>> int3;
cout<<"Enter your 4th number:";
float int4;
cin>> int4;
cout<<"Enter your 5th number:";
float int5;
cin>> int5;
cout<<"Enter your 6th number:";
float int6;
cin>> int6;
cout<<"Enter your estimation:";
float int7;
cin>> int7;



float product_of_int1_int2_int3_int4_int5_int6= int1*int2*int3*int4*int5*int6;
cout << "the product of"  <<int1 
<<"and"  <<int2
<<"and"  <<int3
<<"and"  <<int4
<<"and"  <<int5
<<"and"  <<int6<<"is" 
<<product_of_int1_int2_int3_int4_int5_int6;

float product_of_int7=int7*int7*int7*int7*int7*int7;
cout << "the product of"  <<int7<<"is"
<<product_of_int7;

float difference_of_int8=product_of_int1_int2_int3_int4_  int5_int6-product_of_int7;
cout<<"The difference:"<<"is"
<<difference_of_int8;



if (difference_of_int8<0) {
	cout << difference_of_int8 << ",";

  float the_newst_difference=difference_of_int8*-1;





	cout<<"The posisitve difference:"<<"is"
  <<the_newst_difference;
}






return 0;
}

تم تعديل هذه المشاركة بواسطة Challenger في 23 أكتوبر 2005 في 18:36

#2

اخى فى حاله معرفه عدد مرات التكرار فاستخدم for

استخدم while مع شرط ويسمى هذا الشرط sential condition

يعنى الحلقه تعمل الى ان يحدث شرط يوقف عمل الحلقه

استخدم if فى حاله اختبار شرط ولكنها لا تسمى loop ك while او for

وشكرا اخى

تم تعديل هذه المشاركة بواسطة medo1976 في 23 أكتوبر 2005 في 18:56

#4

بارك الله فيكم

اخواني الاكارم

--------------------

تمام سويت الحل

لكن صراحة ما انطبق على كل الافتراضات اللي سويتها

على العموم رايح احاول اكثر

وما قصرتوا

#include <iostream.h>

int main ()


/*This programme is written by Prof.Challenger:)*/
{cout<<"Enter your 1st number:";
float int1;
cin>> int1;
cout<<"Enter your 2nd number:";
float int2;
cin>> int2;
cout<<"Enter your 3rd number:";
float int3;
cin>> int3;
cout<<"Enter your 4th number:";
float int4;
cin>> int4;
cout<<"Enter your 5th number:";
float int5;
cin>> int5;
cout<<"Enter your 6th number:";
float int6;
cin>> int6;
cout<<"Enter your estimation:";
float int7;
cin>> int7;



float product_of_int1_int2_int3_int4_int5_int6= int1*int2*int3*int4*int5*int6;
cout << "the product of"  <<int1 
<<"and"  <<int2
<<"and"  <<int3
<<"and"  <<int4
<<"and"  <<int5
<<"and"  <<int6<<"is" 
<<product_of_int1_int2_int3_int4_int5_int6;

float product_of_int7=int7*int7*int7*int7*int7*int7;
cout << "the product of"  <<int7<<"is"
<<product_of_int7;

float difference_of_int8=product_of_int1_int2_int3_int4_int5_int6-product_of_int7;
cout<<"The difference:"<<"is"
<<difference_of_int8;


float int9;
if (difference_of_int8<0) {
	cout << difference_of_int8 << ",";

  float int9=difference_of_int8*-1;





	cout<<"The posisitve difference:"<<"is"
  <<int9;
}
float int10;
while (int9>100) {
	float int10=int7-0.15625;
}

cout<<"the_new_estimation:"<<"is"
<<int10;

return 0;
}

هذا الموضوع مغلق.

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

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…