اكتب برنامج C يأخذ عددًا حقيقيًا x ويطبع القيمة المقابلة لـ sin (1 / x) باستخدام 4 منازل عشرية
- برمجة
- برمجة سي c
- 2021-05-02
- Wassim
الأجوبة
/*Write a C program that accepts a real number x and prints out the corresponding value of sin(1/x) using 4-decimal places*/
#include <stdio.h>
#include <math.h>
int main()
{
double x, tval;
printf("Input value of x: \n");
scanf("%lf", & x);
if (x != 0.0)
{
tval = sin(1/x);
printf("Value of sin(1/x) is %0.4lf\n", tval);
}
else
{
printf("Value of x should not be zero.");
}
return 0;
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال