-----------------------------------------------
/* program to print square and cube of numbers between range*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,sq,cu,br,ij;
cout<<"\nEnter a number:";
cin>>br;
cout<<"\nEnter End number:";
cin>>ij;
cout<<"\n--------------------";
for(i=br;i<=ij;i++)
{
sq=i*i;
cu=i*sq;
cout<<"\n\t Number:"<<i;
cout<<"\n\t Square:"<<sq;
cout<<"\n\t Cube :"<<cu;
cout<<"\n--------------------";
}
getch();
}
No comments:
Post a Comment