Print following series 1 3 9 27 81 in C: The series is 1/3 + 1/9 + 1/27 which is equal to Approach: Run a loop from 1 to n and get.
Print following series 1 3 9 27 81 in C
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int c;
for(c=1;c<=200;c*=3)
{
cout<<c<<"\t";
}
getch();
}
Output of Program
1 3 9 27 81