اكتب برنامج C يقرأ رقمين ويقسم الرقم الأول على الرقم الثاني. إذا تعذر التقسيم اطبع "التقسيم غير ممكن"
- برمجة
- برمجة سي c
- 2021-05-01
- Wassim
الأجوبة
/*Write a program that reads two numbers and divide the first number by second number. If the division not possible print "Division not possible"*/
#include
int main() {
int x, y;
float div_result;
printf("Input two numbers: ");
printf("\nx: ");
scanf("%d", &x);
printf("y: ");
scanf("%d", &y);
if(y != 0)
{
div_result = (float)x/(float)y;
printf("%.1f\n", div_result);
}
else
{
printf("Division not possible.\n");
}
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال