how to write a program for raising a number to a power(integer only)
(e.g 2^2=4 ; 3^3=27 etc)
without using a precompiled C function(ie pow()). but only used addition, substraction, while loops,if statement and/or for loop.
erictham83
0
Newbie Poster
Recommended Answers
Jump to PostI still haven't quite figured out the indention method on this forum, and the getchar() at the end are for the Dev-C++ compiler so that the DOS-Prompt doesn't close automatically.
Jump to PostWhy, in any circumstance, would resurrecting a four year old thread to ask a vague question using bad grammar (forget english grammar, I mean C grammar. C doesn't have "commands") be a good idea? Hmmm...
Jump to Post>BimanD
Did you even read what the question posed was...? And what others have replied to it...?
All 10 Replies
Brent_Ritterbec
1
Newbie Poster
Brent_Ritterbec
1
Newbie Poster
gayatridas
0
Newbie Poster
death_oclock
103
Posting Whiz
BimanD
0
Newbie Poster
csurfer
422
Posting Pro
csurfer
422
Posting Pro
mtx_rashid
0
Newbie Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
shiva_202
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.