Answer the question
In order to leave comments, you need to log in
Uninitialized variable "a" used?
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <iostream>
int main()
{
setlocale(LC_ALL, "Rus");
float x = M_PI / 4, y,a;
while ( x <= -M_PI);
{
if (x <= a)
y = (a + exp(x)) / (cos(x) + pow(x, 2) + a);
else
y = a * x + sqrt(fabs(x));
printf_s("Значение 'y' :% lf\t | Значение 'y' :% lf\n", x, y);
x = x += M_PI / 3;
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
1. Use the format tag for your code
2. Read the documentation to the end, google your mistake - it's a common popular one, it makes no sense to ask the thousandth question if there are already 999 answers to it on the Internet.
3. The variable must first be defined, and then work with it. You just start using the variable without first initializing it anywhere - the text of the error DIRECTLY says this. It is necessary not only to declare, but also to set the default value before accessing it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question