hello i'm trying to write a program that allows user to imput integers between 3 and 9 (both included)using a for loop could you please help your assistance will be appreciated highly.so far this is what i got

#include<iostream>
using namespace std;
void main ()
{
	int a;
	for(int 3>=start;9<=end;
	cout<<"enter digit"<<endl;
	cin>>a;
	{
	
		cout<<"good"<<endl;
	}
	
	system ("pause");
}

thanks:)

Narue commented: Why the pointless poll? -4

Recommended Answers

All 2 Replies

see if this corrected syntax helps...

...
for(a; a>=3 && a<=9;){
     cout <<"enter digit" <<endl;
     cin  >> a;
     if(a>=3 && a<=9)
          cout<<"good"<<endl;
}
system("pause");
...

Work on understanding variables and proper syntax before beginning the assignment. Also, to the poster above, please don't provide answers only suggestions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.