Friday, 4 November 2016

Q. WAF to calculate cube of any no.

#include<conio.h>
#include<iostream.h>
float cube_of(float a);
void main()
{
clrscr();
int x,y;
cout<<"Enter a no. ";
cin>>x;
y=cube_of(x);
cout<<"Cube of "<<x<<" = "<<y;
getch();
}
float cube_of(float a)
{
int c;
c=a*a*a;
return(c);
}

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...