Предмет: Информатика, автор: Corscorscors

Нужна помощь с программой. Язык си. После ввода переменной Х должна считать и выводить мне 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 =n ");
scanf("%d",&x);
a = sin(x);
printf("%dn", 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("%dn", y);
return 0;
}

Ответы

Автор ответа: petyaGavrikov
0
#include <stdio.h>
#include <math.h>

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

printf("Enter X =n "); 
scanf("%f",&x);
a = sin(x); 
printf("%fn", 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("%fn", y); 
return 0; 
}
Похожие вопросы