Ang Blog ni Paurong!

Dahil hindi plantsado ang buhay ng tao.

A function-oriented program that calculates the power value of the input base number and exponent number then display the power value.

Posted by Paurong sa Martes, Oktubre 23, 2007

/* A function-oriented program that calculates
the power value of the input base number and
exponent number then display the power value. */

#include <stdio.h>
#include <conio.h>

void main()
{
clrscr();
input();
oper();
getch();
}

int base, ctr=1, exponent, power=0, answer=1;

void input()
{
printf(“Enter base number: “);
scanf(“%d”, &base);
printf(“\nEnter exponent number: “);
scanf(“%d”, &exponent);
}

void oper()
{
for(ctr=1 ; ctr <= exponent ; ctr++)
{
power = base;
answer = answer * power;
}
printf(“\nPower value: %d”, answer);
}

3 Tugon to “A function-oriented program that calculates the power value of the input base number and exponent number then display the power value.”

  1. multiple post alert!

    sang program magagamit yan??

  2. Grace said

    sana, maintindhan ko yan sumday…

  3. Antolin said

    Hehehe this reminds me of my college years…. I had a hard time with the fibonacci…

Mag-iwan ng Tugon

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Palitan )

Twitter picture

You are commenting using your Twitter account. Log Out / Palitan )

Facebook photo

You are commenting using your Facebook account. Log Out / Palitan )

Google+ photo

You are commenting using your Google+ account. Log Out / Palitan )

Connecting to %s

 
%d bloggers like this: