:o
أتمنى أن تدخلوا على هذا الرابط وتبدوون رايكم شاكراً لكم حسن الزيارة:::
http://www.arabteam2000.com/vb/showthread....2311#post132311
أخوكم الـحـــــــــــــــايــــــــر ,,,,,,,,
:o
أتمنى أن تدخلوا على هذا الرابط وتبدوون رايكم شاكراً لكم حسن الزيارة:::
http://www.arabteam2000.com/vb/showthread....2311#post132311
أخوكم الـحـــــــــــــــايــــــــر ,,,,,,,,
بسم الله الرحمن الرحيم
#include
#include // to call getche()
main()
{
float nm1,nm2, result;
char ch;
char c;
do{
//printf("nEnter your operation directly(for example: 2 + 3):n" );
//scanf("%f %c %f", &nm1, &c, &nm2);
printf("nEnter the first number:");
scanf("%f", &nm1);
printf("nEnter the second number:");
scanf("%f", &nm2);
printf("nEnter the Operator:");
scanf("%c", &c);
scanf("%c", &c);
switch©
{
case '+':
{
result=nm1+nm2;
printf("nthe result of nm1+nm2= %f",result);
break;
}
case '-':
{
result=nm1-nm2;
printf("nthe result of nm1-nm2= %f",result);
break;
}
case '*':
{
result=nm1*nm2;
printf("nthe result of nm1*nm2= %f",result);
break;
}
case '/':
{
if (nm2 == 0.0)
//you can't devide by zero
break;
result=nm1/nm2;
printf("nthe result of nm1/nm2= %f",result);
break;
}
default :
printf("nyou enter unknown operator:n");
break;
}
printf("nAgain: (y/n)");
}while( ( ch=getche() ) == 'y' );
return(0);
}هذا الموضوع مغلق.
المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية
جارٍ التحقق من المتواجدين…