本文共 620 字,大约阅读时间需要 2 分钟。
c++立方函数
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr(); //to clear screen
float cube(float); //function prototype
float a,cu;
cout<<“Enter any number:”;
cin>>a;
cu=cube(a); //function calling
cout<<“nCube of “<<a<<” is “<<cu;
getch();
}
float cube(float a)
{
float cu;
cu=a*a*a;
return(cu);
}
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr(); //to clear screen
float cube(float); //function prototype
float a,cu;
cout<<“Enter any number:”;
cin>>a;
cu=cube(a); //function calling
cout<<“nCube of “<<a<<” is “<<cu;
getch();
}
float cube(float a)
{
float cu;
cu=a*a*a;
return(cu);
}
翻译自:
c++立方函数
转载地址:http://ygwwd.baihongyu.com/