COMMENT-:THIS PROGRAM DISPLAY THE SQUARE,CUBE
OF THE NUMBERS
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,i,square,cube;
cout<<"enter the value of n";
cin>>n;
cout<<"cube and square of number is"<<"\n";
for(i=1;i<=n;i++)
{
square=i*i;
cube=i*i*i;
cout<<"\t\t"<<i<<"\t\t"<<square<<"\t\t"<<cube<<"\n";
}
getch();
}
OF THE NUMBERS
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,i,square,cube;
cout<<"enter the value of n";
cin>>n;
cout<<"cube and square of number is"<<"\n";
for(i=1;i<=n;i++)
{
square=i*i;
cube=i*i*i;
cout<<"\t\t"<<i<<"\t\t"<<square<<"\t\t"<<cube<<"\n";
}
getch();
}
0 comments:
Post a Comment