Home > Back-end >  C language newcomer help grammar is no problem, why don't the output
C language newcomer help grammar is no problem, why don't the output

Time:09-29

#include
#include
The main ()
{int n;
Float s1, s2;
S1=0.0; S2=0.0;
Lf the scanf (" % % lf ", & amp; S1, & amp; S2);
While (s2 - s1 & gt; E=1-5)
{the for (n=2; N<=2 * n; N +=2)
S1=n * n/(n - 1) * (n + 1);
Printf (" % lf ", s1);
{the for (n=2; N<=2 * n + 2; N +=2)
S2=n * n/(n - 1) * (n + 1);
Printf (" % lf ", s2);
}
}
}

CodePudding user response:

An initial value first n no
Second, the lf to % f, % % lf is of type double

CodePudding user response:

Said is wrong, for in it an initial value for n, % lf instead

CodePudding user response:

In addition, there is a matter of priority, method, you so calculate, s1 and s2 are greater than zero, so while you have any question, if the input less than s1, s2 can not get in the while loop
  • Related