•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 423,369 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,998 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 3442 | Replies: 2
![]() |
•
•
Join Date: Aug 2004
Posts: 24
Reputation:
Rep Power: 5
Solved Threads: 0
#include <stdio.h>
int main(void)
{
This is just something I threw together in about a minute.
int main(void)
{
int base, power, index;
long answer;
base = 0;
power = 0;
answer = 1.00;
printf("Enter a base number: ");
scanf("%d", &base);
printf("Enter a power to raise the base to: ");
scanf("%d", &power);
for(index = 1; index <= power; index++)answer = answer * base;
printf("%d raised to the power of %d is %ld.", base, power, answer);}
getchar();
getchar();
return 0;
This is just something I threw together in about a minute.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Please some one write this program (C++)
- How can I write this program. (C++)
- How can I write a program with 3 classes? (C)
- How to write a program using a stack (C++)
- Trying to write a program that you can enter #s and multiply at the end. (Java)
- write a program that simulates rooling a pair of dice. (Java)
Other Threads in the C Forum
- Previous Thread: evaluating expression using tree
- Next Thread: Tutorial on Hardware in C


Linear Mode