1
12
123
1234
12345
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int i, prevterm = 1, nexterm;
for ( i=0; i<=n; i++)
{
nexterm
cout << prevterm << prevterm
nexterm = ++prevterm
nth term = 10^(n-1)(n-1) + n
2 + (2-1) = 21
3 + 2 = 23
1
12
123
1234
12345
No comments:
Post a Comment