اكتب برنامج C يأخذ المسافة بالسنتيمتر ويطبع القيمة المقابلة بالبوصة
- برمجة
- برمجة سي c
- 2021-05-02
- Wassim
الأجوبة
/*Write a C program that accepts a distance in centimeters and prints the corresponding value in inches*/
#include <stdio.h>
#define INCH_TO_CM 2.54
int main()
{
double inch, cm;
printf("Input the distance in cm:\n");
scanf("%lf", &cm);
inch = cm / INCH_TO_CM;
printf("Distance of %0.2lf cms is = %0.2lf inches\n", cm, inch);
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال