L
L
Lyova Lyova2017-10-12 17:49:15
C++ / C#
Lyova Lyova, 2017-10-12 17:49:15

I can't find a loop error. What should I do?

The user enters an interval from h to m. At the same time, h must be less than mH and M are real numbers. It is necessary to determine the number of numbers in the sequence (n-1)^2/n,(n=1,2,3,... ) falling into the interval [h,m].
Display the found numbers and their number on the screen.
My code:
#include
using namespace std;
int main()
{
setlocale(0, "");
float h,p=0,m;
intn=1,count=1;
cout<<"Enter numbers [h,m]"<>h>>m;
while (p<=m)
{
if (p>=h)
{
cout<

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question