Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3.
#include<iostream>
#include<string>
using namespace std;
int main(){
int number;
cout<<"Enter number >1: ";
cin>>number;
cout<<"\nAll numbers that are greater than 3:\n";
for(int i=1;i<=number;i++){
if(i>3){
cout<<i<<"\n";
}
}
cin>>number;
return 0;
}
Comments
Leave a comment