Problem :- Write A C++ Program To Find Cube Of Any Number Using Functions .
Logic :- Very Simple Just pass the value in Function If you don't know Function You Can see the another Example C Program to Display Prime Numbers Between Intervals Using Using Function
Solution :-
Output:-
Logic :- Very Simple Just pass the value in Function If you don't know Function You Can see the another Example C Program to Display Prime Numbers Between Intervals Using Using Function
Solution :-
#include<iostream>
using namespace std;
int main()
{
//By-Ghanendra Yadav
float cube(float); //Function Type is float
float num,cu;
cout<<"Enter Any Number To Find Cube :\t";
cin>>num;
cu=cube(num);
cout<<"\nCube Of "<<num<<" is = "<<cu<<endl<<endl;
return 0;
}
float cube(float a)
{
float cu;
cu=a*a*a;
return(cu);
}
Output:-
what is cu??
ReplyDeleteHello,
Deleteas you can see that I have taken Two float variable num and cu. in num we store user input and in cu we are taking the final output and printing in console.
Don't worry this program is very old when I was beginner in programming this is just a n experiment.
Keep visit, Like and Share.
bro do u whatsapp??? my num is 03431530052 i am doing BS it i may have some problems ... and need help
DeleteHello, Faheem
DeleteI have whatsapp but sorry to inform you I don't use whatsapp for programming related issue.
I have some platform where you can join or follow me. I can help you better you can ask me anything related to programming I definitely try to solve your problem.
Check These Link and join me.
Learn About Blogging- Click Here
1. Facebook Page- Click Here
2. Facebook Group- Click Here
3. Twitter- Click Here
4. Google Plus- Click Here
5. Pinterst- Click Here
6. Linkedin Group- Click Here
7. Tumblr- Click Here
8. Github- Click Here
9. Quora Blog- Click Here
Thanks and keep support by sharing.