I must write a program that displays values sequentially according to the input value, use a variable to store the value entered.
An example of what the program should do
Input Data: Enter a value. 8
Output data: 8.1, 8.12, 8.123, 8.1234, 8.12345, 8.123456, 8.1234567
What must happen in the program is: that at the time of writing any number the following numbers are displayed in a decimal manner but it stops at a lower number than the initial number.
Please help me correct my mistakes.
What I have is this:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <math.h>
using namespace std;
int main()
{ float N_inicial, N_final, N, secuencia;
char valor;
cout<<"\n";
cout<<" \t \t Bienvendido/a... \n Secuencia de numeros \n";
cout<<"\n";
cout<<"Ingrese un valor: \n"; cin>>N_final;
{
secuencia= N_final+N;
for (float N = N_inicial; N_inicial = N_final-1; N <= N_final);
{
cout<<N_final<<(".");
for ( char valor = 1; 1<=valor; valor++ );
{
cout<<valor;
}
cout<<endl;
}
}
}