I am trying to learn C++ by myself. I looked up a sample question after going through some text. Though I would like someone to review my code.  I'm basically asking you to break it to show some flaws or some thing I missed.  As a beginner I tried exhaustively to improve it and now hit a wall to analyse robustness of the code.Problem statement:In this challenge, write a program that takes in three arguments, a  start temperature (in Celsius), an end temperature (in Celsius) and a  step size. Print out a table that goes from the start temperature to  the end temperature, in steps of the step size; you do not actually  need to print the final end temperature if the step size does not  exactly match. You should perform input validation: do not accept  start temperatures less than a lower limit (which your code should  specify as a constant) or higher than an upper limit (which your code  should also specify). You should not allow a step size greater than  the difference in temperatures.#include <iostream>#include <cstdlib>#include <string>#define LOWER_LIMIT 23.3#define UPPER_LIMIT 256.3using namespace std;bool isnum(string s){    //check if the string is a number    //48 & 57    int len = s.length();    for(int i = 0; i < len; i++)        {        //cout << s[i] << \t << int(s[i])<< endl;        if(int(s[i])>=48 && int(s[i])<=57)            return true;        else        {            return false;            break;        }    }}int main(int argc, char** argv)//The int argc holds the argument count and the argv is a 2-D array4// of characters{    double start,end,step_size;    if(argc!=4)    {        cout<<Please enter three intigers<<endl;        cout<<celcius <start_temprature> <end_temprature> <step_size><<endl;        cout<<Last step may not be printed<<endl;    }    else    {        //check if all the arguments are intigers        if(isnum(argv[1]) && isnum(argv[2]) && isnum(argv[3]))        {               cout<<argv[1]<<endl;            cout<<argv[2]<<endl;            cout<<argv[2]<<endl;            start = atof(argv[1]);            end = atof(argv[2]);            step_size = atof(argv[3]);            //calculate the table and print.            if(start < LOWER_LIMIT || start >UPPER_LIMIT)            {                cout<<The <start_temprature> does not meet the limit requirement (<<LOWER_LIMIT<<\u00B0<<C - <<UPPER_LIMIT<<\u00B0<<C)<<endl;                // The degree symbol to be printed on command line requires UTF-8 characters which has the degree symbol and the location is \u00B0                return -1;            }            if(end >UPPER_LIMIT || end <LOWER_LIMIT)            {                cout<<The <end_temprature> does not meet the requirement (<<LOWER_LIMIT<<\u00B0<<C - <<UPPER_LIMIT<<\u00B0<<C) <endl;                             return -1;            }            if (step_size  <1 || step_size >=(UPPER_LIMIT - LOWER_LIMIT))            {   //zero or negetive stepsize checking                cout<<The step_size cannot be negetive, zero or greater than or equal to step_size<<endl;                return -1;            }            if(end<start) //swapping variables if start is greater than end            {                cout <<Swapped! end and start values for simplicity <<endl;                double tmp = start;                start = end;                end = tmp;            }            cout << start <<start<<endl;            cout << end <<end<<endl;            cout << step_size <<step_size<<endl;            int nend = (int)((end-start)/step_size);            cout << nend <<number of iterations<<endl;            for(int i = 0; i < nend ;i++)            {                cout << start << \u00B0<<C  =   << ((start*(9/5))+32) << \u00B0<<F <<endl;                start += (double)step_size;            }        }        else        cout <<All three input arguments must be positive numbers! <<endl;    }}
Print out table with start/end temperatures and step size
c++;beginner
Automatically detectable bugsFirst, let the compiler do some reviewing:$ clang++ -Wall -c cr44821.cppcr44821.cpp:26:1: warning: control may reach end of non-void function      [-Wreturn-type]}^1 warning generated.User experienceI found your program to be infuriating to use.  My first few attempts to run the program all failed; I would have expected all of them to produce reasonable output.$ ./cr44821 -40 +40 0.5All three input arguments must be positive numbers!$ ./cr44821 0 +40 0.5All three input arguments must be positive numbers!$ ./cr44821 0 40 0.504040The <start_temprature> does not meet the limit requirement (23.3C - 256.3C)$ ./cr44821 23.3 +40 0.5All three input arguments must be positive numbers!$ ./cr44821 23.3 40 0.523.34040The step_size cannot be negetive, zero or greater than or equal to step_sizeI finally succeeded in getting an incomplete response.  What happened to 24.3C?$ ./cr44821 23.3 25 123.32525start 23.3end 25step_size 11number of iterations23.3C  =  55.3FMy frustration appears to be partly a consequence of poor number parsing, and partly a consequence of artificial temperature limits.  Reasonable limits, I think, are 273.15C (absolute zero) for the lower bound, and 1.4e32C (absolute hot) for the upper bound.  (std::numeric_limits<double>::max() is 9.9e307, which is too large.)Problem decompositionThere is plenty of action going on in main().  The temperature conversion calculation itself does not belong there.  This problem cries out for a functiondouble c_to_f(double celsius) {    return celsius / 5 * 9 + 32;}