Terms of AP In C++
RELATED POSTS
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
C/C++,java,python c++ keywords, identifiers, data types,variables,modifiers,storage classes,operators,for loop ,while loop,do while loop,if else statement,nested loops,break continue goto statement,functions ,call by value call by reference ,arrays ,strings,pointers,data structures ,classes and objects,inheritance,polymorphism,operator overloading,function overloading,data abstraction,data encapsulation,dynamic memory allocation for array and objects,function templates,class templates,
Terms of AP In C++
Integer x
Terms of series (separated by space)
1 <= x <= 1,000
10
5 11 14 17 23 26 29 35 38 41
4
5 11 14 17
C++ Code :
#include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
int x=(3*i)+2;
if(x%4==0)
{
n=n+1;
continue;
}
cout<<x<<" ";
}
}
0 comments:
Post a Comment