Posts

Showing posts with the label تبديل قيم المتغيرات

تطبيق الامثله السابقه على function الفنكشن

امثله على ال function مثال علامات 10 طلاب ..الخ   #include <iostream> #include <string> using namespace std ; float min1(float x1,float x2,float x3,float x4,float x5,float x6,float x7,float x8,float x9,float x10){ float min; min=x1; if (min>x2) min=x2;  if (min>x3) min=x3;  if (min>x4) min=x4;  if (min>x5) min=x5; if (min>x6) min=x6; if (min>x7) min=x7; if (min>x8) min=x8; if (min>x9) min=x9; if (min>x10) min=x10; return min ; } float max1(float x1,float x2,float x3,float x4,float x5,float x6,float x7,float x8,float x9,float x10){  float max=x1; if (max<x2)  max=x2;  if (max<x3)  max=x3;    if (max<x4)  max=x4;    if (max<x5)  max=x5; if (max<x6)  max=x6;  if (max<x7)  max=x7;  if (max<x8)  max=x8;    if (max<x9)  max=x9; if (max<x10)  max=x10; } void main () {  for(int i=0;i<10;...

امثله على ماسبق من الدروس

الامثلة: للتبديل بين قيم متغيرين نحن بحاجه الى متغير ثالث  كما في المثال :  #include <iostream> #include <string> using namespace std ; void main () { int x=50,y=10; int t; cout<<"x="<<x<<"y="<<y<<endl; t=x; x=y; y=t; cout<<"x="<<x<<"y="<<y<<endl; system("pause");  }  برنامج يطبع فاتوره حيث يدخل اسم الموظف و عدد ساعات العمل في اليوم   يطبع البرنامج الاسم وعدد ساعات العمل في الشهر  و الراتب    و مقدار خصم الضريبه و قيمه الراتب بعد الضريبه   علما بان عدد ايام الدوام الفعلي 22يوم في الشهر   و الساعه ب20$ دولار   والضريبه  0.06 %    #include <iostream> #include <string> using namespace std ; void main (){ string name ; float work_hours,  work_hours_in_month,   salary,       tax,     after_tax ; cout<<"enter the name: \t"; cin >...