عرض مشاركة واحدة
  #151  
قديم 26-11-2008, 10:47 AM
الصورة الرمزية msamido
msamido msamido غير متواجد حالياً
عضو متألق
 
تاريخ التسجيل: Jul 2005
العمر: 39
المشاركات: 2,701
معدل تقييم المستوى: 0
msamido is an unknown quantity at this point
افتراضي

اقتباس:
المشاركة الأصلية كتبت بواسطة ananoo مشاهدة المشاركة
السلام عليكم
انا عملتها

كود:
#include <iostream.h>
#include <conio.h>
void main()
{
int complete;
cout<<"\n to stsrt press 0:";
cin>>complete;
while(complete==0)
{
int input;
int firstno;
int secondno;
int result;
cout<<"\n\t\t Enter the first NO:";
cin>>firstno;
cout<<"\n\t\t Enter the srcond No:";
cin>>secondno;
 
cout<<"\n\t\t\t\t for(+) Enter 1";
cout<<"\n\t\t\t\t for(-) Enter 2";
cout<<"\n\t\t\t\t for(*) Enter 3";
cout<<"\n\t\t\t\t for(\) Enter 4";
cout<<"\n seliction";
cin>>input;
switch (input) {
case 1:   //Note the colon,not a semicolon
{
result=firstno+secondno;
cout<<"\n\t\t\t the result:"<<result;
break;
}
case 2:  //Note the colon,not a semicolon
{
result=firstno-secondno;
cout<<"\n\t\t\t the result"<<result;
break;
}
case 3:  //note the colon,not a semicolon
{
result=firstno*secondno;
cout<<"\n\t\t\t the result:"<<result;
break;
}
case 4:  //note the colon,not a semicolon
{
result=firstno/secondno;
cout<<"\n\t\t\t the result:"<<result;
break;
}
default:   //note the colon,not a semicolon
{
cout<<"\n\t\t\t error,bad input";
break;
}
}
cout<<"\n to complete press 0:";
cin>>complete;
}
}
و ديه النتيجة


صح و لا في لخبطة ؟؟؟
الله ينور يا ananoo بجد أنا سعيد بالمجهود ده وبالتفكير


بس ليا بقى سؤال ؟؟
إنتى ليه حاطه الـ comment da فى كل سطر .... جنب الـ case

كود:
//Note the colon not semicolon



اقتباس:
المشاركة الأصلية كتبت بواسطة همس مشاهدة المشاركة
انا لسا شايفة السؤال حالا


عموما هفكر فيها برده لو ليها طريقة تانية غير الي ananoo

بس اعذروني على تقصيري في دخول الموضوع

ومتابعته لاني بجد بالعااااااااااافية بفوق من الامتحانات الي مش راضية تخلص وكل شوية يطلع امتحان جديد ونعيد ونزيد في الامتحانات

هفكر ان شاء الله

لو سمحت يا باشمهندس لو ليها حل تاني مش تقوله لحد ما اقول لحضرتك اني مش عرفت
ربنا معاكى يا همس بجد وشدى حيلك وربنا يوفقك بإذن الله
أنا عارف إن امتحانات أول ميد تيرم دى بتبقى رخمة شويه ربنا معاكى
وانا مش هقول أى حاجه دلوقتى لغاية ما تيجى تانى

ربنا يوفقكم جميعا بإذن الله
.
.
__________________