• Нужна помощь с программой. Язык си. После ввода переменной Х должна считать и выводить мне Y, но, почему-то, выводит мне Х.


    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <conio.h>

    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char *argv[]) {
    double x = 0;
    double a;
    double b;
    double c;
    double y = 0;

    printf("Enter X = ");
    scanf("%d",&x);
    a = sin(x);
    printf("%d", a);
    b = pow(cos(x), 2);
    c = 1 + tan(x);
    y = 4 * pow(a, 2) + x * (pow(b, 2) + x * (pow(c, 2) + x * (a * b + pow((a + b), x))));
    printf("%d", y);
    return 0;
    }

Ответы 1

  • #include <stdio.h>#include <math.h>int main(int argc, char *argv[]) {float x, a, b, c, y;printf("Enter X = "); scanf("%f",&x);a = sin(x); printf("%f", a);b = pow(cos(x), 2); c = 1 + tan(x); y = 4*pow(a,2) + x*(pow(b,2) + x*(pow(c,2) + x*(a*b+pow((a+b),x)))); printf("%f", y); return 0; }
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years