uz
Feedback
تعلم البرمجة بلغة<++C> من البداية

تعلم البرمجة بلغة<++C> من البداية

Kanalga Telegram’da o‘tish

@includeCCPLUSPLUS

Ko'proq ko'rsatish
Mamlakat belgilanmaganToif belgilanmagan
1 087
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kun
Ma'lumot yo'q30 kun
Postlar arxiv
ماذا يقصد بمعامل التعبير الشرطي: "conditional expression" تعني كتابه جمله if ...else بطريقه مختصره وتستخدم الرموز( ؟ و : ) في صوره ثلاثيه خاصه condition ? expression1 : expression2; هذه القيمه الناتجه قد تكون قيمه التعبير الاول او قيمه التعبير الثاني تبع حاله الشرط اذا مان صحيح او خاطيء مثال : min= x

في البرنامج مثلآ تم ادخال الدرجه 47 يتم القسمة على عشره فتقدر القيمه ب 4 فيتم تنفيذ مافي case 4 ثم تنفذ كل الجمل الموجوده اليbreak فيتم علي كل الحالات الي ان نصل الي الحاله رقم صفر وbreak التاليه لها. هذه الظاهرة تسمي الاخفاق " fall through "

//برنامج يؤدي نفس اداء البرنامج السابق في البرنامج السابق استخدمنا ال if else لكن بالبرنامج هذا استخدمنا ال switch 💞💞💞💞💞💞 #include <iostream> using namespace std; int main(){ int score; cout<<"enter the test score\n"; cin>>score; switch (score/10){ case 10: case 9: cout<< A <<endl; break; case 8:cout<< B <<endl; break; case 7:cout<< C <<endl; break; case 6:cout<< D <<endl; break; case 5: case 4: case 3: case 2: case 1: case 0:cout<< F <<endl; break; default:cout<<"error:score is out of rang\n"; } return 0; } مخرجات كلا البرنامجين نفس المخرجات 👌

//برنامج لتحويل درجه الاختبارات إلي مايكافئها من الحروف الابجديه 🌸🌸🌸🌸 #include <iostream> using namespace std; int main(){ int score; cout<<"enter the test score\n"; cin>>score; if(score > 100) cout<<"error:score is out of range\n"; else if(score >= 90) cout<< A ; else if(score >= 80) cout<< B ; else if(score >= 70) cout<< c ; else if(score >= 60) cout<< D ; else if(score >= 0) cout<< F ; else cout<<"error:score is out of range"; return 0; }

حساب القيمه العظمي بين ثلاثة اعدد مدخله باستخدام if else . ✨✨✨✨✨ #include <iostream> using namespace std; int main(){ int a,b,c,max; cout<<"enter 3 number\n"; cin>>a>>b>>c; if(a > b) if(a > c) max=a; else max=c; else if(b > c) max=b; else max=c; cout<<"the maximum is"<<max<<endl; return 0; }

//برنامج يسمح للمستخدم بإدخال اما Y او y للإجابة "yes" 💞💞💞💞 #include <iostream> using namespace std; int main(){ char ans; cout<<"Are you enrolled (y/n):\n"; cin>>ans; if(ans == Y || ans == y ) cout<<"you are enrolled:\n"; else cout<<"you arn not enrolled:\n"; return 0; }

//ايجاد القيمه العظمي من بين ثلاثة اعدد صحيحه باستخدام الشروط المركبه. 👍 #include <iostream> using namespace std; int main(){ int a,b,c; cout<<"enter 3 number\n"; cin>>a>>b>>c; if(a >= b && a >= c) cout<< a <<endl; if(b >= a && b >= c) cout<< b <<endl; if(c >= a && b >=b) cout<< c <<endl; return 0; } 👏👏👏👏

< C++ > برمجة: الكلمات المفتاحية (الكلمات المحجوزه) key word : في لغه C++ كلمات معرفه مسبقآ ومحجوزه لغرص خاص . حيث يوجد 48 كلمه مفتاحيه بلغه C++ وهي: asm 🌸 auto 🌸 break 🌸 case 🌸 catch 🌸 char 🌸 class 🌸 const 🌸 continue 🌸 default 🌸 delete 🌸 do 🌸 double 🌸 else 🌸 enum 🌸 extern 🌸 float 🌸 for 🌸 friend 🌸 goto 🌸 if 🌸 inline 🌸 int 🌸 long 🌸 new 🌸 operator 🌸 private 🌸 protected 🌸 public 🌸 register 🌸 retutnc 🌸 short 🌸 signed 🌸 size of 🌸 static 🌸 struct🌸 switch 🌸 template 🌸 this 🌸 throw 🌸 try 🌸 typedef 🌸 union 🌸 unsigned 🌸 virtual 🌸void 🌸 volatile 🌸 while حيث ان لغه C تحوي 32 كلمه من الكلمات المحجوزه بلغه C++ ✍

//برنامج يقرأ عددين من الإعداد الصحيحه ويخرجهم تبعا للترتيب التصاعدي: 🌸🌸🌸🌸 #include <iostream> using namespace std; int main(){ int a,b; cout<<"enter 2 number\n"; cin>>a>>b; if(a > b){ int temp = a; a= b; b=temp;} cout<<a <<" "<<b <<endl; return 0; } ويمكن أيضا بدون استخدام temp كالتالي. if(a < b) cout<<a <<" "<<b <<endl; else cout<<b <<" "<<a <<endl;

//ايجاد العدد الاكبر بين ثلاثة اعداد مدخله ✨✨✨ #include <iostream> using namespace std; int main(){ int a,b,c,max; cout<<"enter 3 number\n"; cin>>a>>b>>c; max=a; if(b > max ) max=b; if(c > max) max=c; cout<<"the maximum is"<< max <<endl; return 0; }

//ايجاد العدد الاكبر بين عددين مدخلين. ✨✨✨ #include <iostream> using namespace std; int main(){ int a,b; cout<<"enter 2 number\n"; cin>>a>>b; if(a>=b) cout<< a <<endl; else cout<< b <<endl; return 0; }

في بدايه القناه كتبنا برنامج لتحويل الحرف الي الاسكي كود باستخدام داله ;()getche وهذا البرنامج لتحويل الحرف الي ASCII ✍ كلا البرامج يخرج نفس المخرج #include <iostream> using namespace std; int main(){ char n; cout<<"please enter character\n"; cin>>n; cout<<"the ASCII for "<<n<<"="<<(int) n; return 0; }

//برنامج يقوم بقراءه اربعه اعداد وطباعه اكبر عدد مدخل👏👏👏👏 #include <iostream> using namespace std; int main(){ int a,b,c,d,max; cout<<"please enter 4 number\n"; cin>>a>>b>>c>>d; max=a; if(b >max) max=b; if(c>max) max=c; if(d>max) max=d; cout<<"the maximum="<<max; return 0; }

آ๘ﮩ₰ﮩ₰ﮩ.❥ُ ِ العدد الصحيح m يكون من مضاعفات العدد الصحيح n اذا كان باقي خارج قسمه m على n يساوي صفر 👍

//برنامج لمعرفه اذا كان احد العددين يتكون من مضاعفات الاخر ام لا #include <iostream> using namespace std; int main(){ int m , n; cin>> m>> n; cout<<(m%n==0 || n%m==0 ? "mutiple": "not")<<endl; return 0; }

القاسم المشترك الأكبر مثلا معنى رقمين 14 و35 نطلع قواسم كل عدد مثلا قواسم العدد14 هم 1. 2. 7. 14 والعدد 35 هم 1. 5. 7. 35 نشوف المشترك بينهم الأكبر هو 7

//برنامج لادخال عددين وايجاد القاسم المشترك الاكبر بينهما #include <iostream> using namespace std; int main(){ int f,s; cout<<"enter the first number\n"; cin>>f; cout<<"enter the second number\n"; cin>>s; while (f!=s){ if(f>s) f-=s; if(f<s) s-=f;} cout<<"the result="<<s; return 0; }

//التحويل من النظام العشري الي النظام السادس عشر #include <iostream> using namespace std; int main(){ int value; cout<<"please enter the decimal number\n"; cin>>value; cout<<"the hexadecimal system for\n"<<value<<"="<<hex<<value; return 0; }

//التحويل من النظام العشري الي النظام الثماني #include <iostream> using namespace std; int main(){ int value; cout<<"please enter the decimal number\n"; cin>>value; cout<<"the octal system for\n"<<value<<"="<<oct<<value; return 0; }

آ๘ﮩ₰ﮩ₰ﮩ.❥ُ ِ ...: اذا ادخل x=6 y=3 18