Tuesday, 4 October 2016

Program to find Square and Cube of a number .

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<“Enter any number “;
cin>>a;
b=a*a;
c=a*a*a;
cout<<“Square of the entered number is “<<b<<“\n”;
cout<<“Cube of the entered number is “<<c;
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...