🔒 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
  • 941
    Views
  • 2
    Participants
Last reply from:
lenka08

Trending Topics

Online now

Members online
1,063
Guests online
938
Total visitors
2,001

Forum statistics

Threads
2,274,911
Posts
28,959,286
Members
1,233,484
Latest member
asawakoo03
Back
Top