swatch case شرح البرنامج بلغه c عمل البرنامج ضع اي رقممان تريد تقوم بالاختيار بين الجمع الطرح الضرب القسمه كود: #include void main() { تعريف القربل int a,b,c,sum,sub,prod,div; امر الادخال printf("\nplease inter the farst number"); طلب الادخال الاول scanf("%i",&a); طلب الدخال الثاني printf("\nplease inter the scand number"); امر الادخال الثاني scanf("%i",&b); اختر printf("\n 1 sumation"); printf("\n 2 subtion"); printf("\n 3 miltplication"); printf("\n 4 prodact"); printf("\n enter any case you want "); ضع اي رقم scanf("%i",&c); قاعده switch(c) { case 1: sum = a + b; printf("\n total is equal =%i",sum);break; case 2: sub = a - b; printf("\n subtion is equal =%i",sub); break; case 3: prod = a * b; printf("\n prod is equal =%i",prod); break; case 4 : div = a / b; printf("\n divtion is equal =%i",div); break; case 5: printf("\n empty");break; } } الالبرنامج من غير شرح كود بلغة HTML: #include void main() { int a,b,c,sum,sub,prod,div; printf("\nplease inter the farst number"); scanf("%i",&a); printf("\nplease inter the scand number"); scanf("%i",&b); printf("\n 1 sumation"); printf("\n 2 subtion"); printf("\n 3 miltplication"); printf("\n 4 prodact"); printf("\n enter any case you want "); scanf("%i",&c); switch(c) { case 1: sum = a + b; printf("\n total is equal =%i",sum);break; case 2: sub = a - b; printf("\n subtion is equal =%i",sub); break; case 3: prod = a * b; printf("\n prod is equal =%i",prod); break; case 4 : div = a / b; printf("\n divtion is equal =%i",div); break; case 5: printf("\n empty");break; } } |
الساعة الآن 03:38 PM |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir