Calculate Power of a number using while Loop

/* Write a program to Calculate Power of a number using while Loop */

#include<stdio.h>
#include<conio.h>
void main()
{
int p,p1;
float n,power=1.0;
clrscr();
printf("\nEnter the Number & Power ");
scanf("%f%d",&n,&p);
p1=p;
while(p>=1)
{
power=power * n;
p--;
}
printf("\n %f raise to Power %d is = %f ",n,p,power);
getch();

}

Who's online

We have 16 guests and one member online

About Us

Harsimran Singh

Hello

This website is a special gift for Programming Lovers , which want to learn basic Programming Languages and want to develop there skills Read More....

Our work

Find Us

This email address is being protected from spambots. You need JavaScript enabled to view it.

Harsimran Singh(Facebook)

Harsimran Singh(about.me)

Harsimran Singh(G+)