Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- //if user input odd number
- if(n%2==1)
- {
- for(int i = 1; i <= 6;i++)
- {
- cout<<n<<endl;
- n +=2;
- }
- }
- //if user input even number
- else if(n%2==0)
- {
- n = n+1;
- for(int i =1 ; i<=6 ; i++)
- {
- cout<<n<<endl;
- n += 2;
- }
- }
- }
- //visit http://codesolu.rf.gd for more
- //thank you
Advertisement
Add Comment
Please, Sign In to add comment