🔒 Closed Square and Cube a #

Status
Not open for further replies.

avajbt

Fanatic
Basic C/C++

code:

#include <iostream>
#include <conio.h>

using namespace std;

int main(){

int num;
int prod;
int sqrt;
int cube;

cout<<"Enter A Number: ";
cin>>num;

cout<<"\nn"<<"\tn*2"<<"\tn^2"<<"\tn^3\n"<<endl;

for (int i=1; i<=num; i++)
{

prod= i*2;
sqrt= i*i;
cube= i*i*i;

cout<<i;

cout<<"\t"<<prod;


cout<<"\t"<<sqrt;


cout<<"\t"<<cube<<endl;




}

getch();
return 0;

}
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 974
    Views
  • 2
    Participants
Last reply from:
lenka08

Trending Topics

Online now

Members online
641
Guests online
2,727
Total visitors
3,368

Forum statistics

Threads
2,328,973
Posts
29,245,514
Members
1,158,176
Latest member
Jaxx69
Back
Top