I'm new, and I don't know why this does not run successfully.

I am a student and starting to learn C++. Here is the question: The program accepts two positive integers from the input. Output every integer from the first number up to and including the second number. However, you have to precede every integer with the character 1.


Here is code

#include<iostream>

using namespace std;
using std::cin;
using std::cout;

int main()
{
int first, second;
cin>>first>>second;

while(first<=second);
{

cout<<"1"<<first<<",";
first++;
}
}
Remove the semi-colon on the while loop line.
It is solved right now. I do not know how to reply in others chat. But thanks a lot, Ganado.
This chat is ancient, it does not support that, another post is correct.
Topic archived. No new replies allowed.