Brijmohan lal Sahu - Facebook
ads
ads

Thursday, October 30, 2014

Program to print a square and cube of any number






/* program to print a square and cube of any number */

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,sq,cu;
cout<<"\nEnter a number:";
cin>>a;
sq=a*a;
cu=a*sq;

cout<<"\n--------------------";
cout<<"\n\t Number:"<<a;
cout<<"\n\t Square:"<<sq;
cout<<"\n\t Cube  :"<<cu;

cout<<"\n--------------------";

getch();
}

No comments:

Post a Comment