Computer Science, asked by bvsrividya4, 3 months ago

Write a program in C++ to display the following number series.
1 8 27 64​

Answers

Answered by buttfiza66
2

Answer:

#include<iostream>

using namespace std;

int main()

{

for(int i=1;i<=4;i++)

{

cout<<i*i*i<<endl;

}

}

Explanation:

output:

1

8

27

64

Answered by anindyaadhikari13
4

Answer:

This is the required C++ program for the question.

#include <iostream>

using namespace std;

int main()  {

   int n,i;

   cout << "Enter limit - ";

   cin >>n;

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

       cout << i*i*i << " ";

   }

   return 0;

}

Algorithm:

  1. Accepting the limit from the user.
  2. Iterating numbers from 1 to the given range.
  3. Display the cube of each numbers in the range.

See the attachment for output.

Attachments:
Similar questions