| | |
Pow Function
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
Im a Novice in C++ and Im writting test in few weeks time... have got this question paper and there is something about pow function... when I asked my instructor about it, he just gave me his usually glance and say I must figure it out....well now back to my concern...what is pow function, how does it work, when and where do u use it, have got some information from the net and have heard that is a power something but I dont believe that the info I have got is enough... coz it doesnt really give me an answer to my questions maybe am searching from the wrong sources... if possible I wud appreciate an example with such function
I’m not sure if this time around im being lazy or what…. Have paged my text book from the 1st page to the last one but no lucky I think Massonon hath 4got to include it in his last edition
I’m not sure if this time around im being lazy or what…. Have paged my text book from the 1st page to the last one but no lucky I think Massonon hath 4got to include it in his last edition
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
•
•
Join Date: Apr 2008
Posts: 49
Reputation:
Solved Threads: 3
The following code is a very simple program using the pow function. It is in the cmath library, so you need to make sure you include that. The output for the program would be:
The cube of 4 is 64.
Hope that helps.
The cube of 4 is 64.
c++ Syntax (Toggle Plain Text)
#include <iostream> #include <cmath> int main() { int num = 4, cube; cube = pow (num, 3); cout << "The cube of " << num << " is " << cube << ".\n"; return 0; }
Hope that helps.
![]() |
Similar Threads
- pow(a, b) fails compiler (C++)
- Using Math.pow() (Java)
- help with POW command (C)
- CAn any1 tell me watz wrong in da code (C++)
- i need code for binary to decimal (it should be written in 'C') (C)
- need help for programming (C++)
- how to call this function...using menu..! (C++)
- New 2 C++, help with finding erros (C++)
- loop in main function to an "if" statement (C++)
Other Threads in the C++ Forum
- Previous Thread: Mobile Applications
- Next Thread: Need TAPI component
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





