1.

Cpp program to print triangle of cube series as18 827 27 2764 64 64 64

Answer»

Answer:

The given co‎de is written in C++.

#INCLUDE

using namespace std;

int main() {

   int n,i,J;

   cout<<"Enter limit - ";

   cin>>n;

   for(i=1;i<=n;i++){

       for(j=1;j<=i;j++)

           cout<

       cout<

   }

   return 0;

}

The outer loop iterates in the range 1 - n. It determines the number of rows for the pattern. The inner loop iterates in the range 1 - i where i is the ROW number (as nth row has n number of cols). Inside the inner loop, the value of i³ is displayed. At LAST, a new LINE is added.

See the attachment for output.

•••♪



Discussion

No Comment Found