Ok so i have trouble with looping with while and for statments
heres the questions: 1. Write a program that gets a positive integer from the user and prints all the numbers from one to that integer. If the inputted number is zero or negative, then the program will print an error and quit.
I dont have much, but this is all i have:
#include <iostream>
using namespace std;
int main()
{
int num=1, i;
cout<<"please enter a number"<<endl;
cin>>i>>
while num<i;
cout<< num+1<<;
return 0;
}
Can someone please to me what to add and the correct format