GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Placement Papers  >  Aztec Systems  >  C

 Print  |  
Question:  Two numbers are entered through keyboard, write a program to find the value of one number raised to the power another.



October 10, 2009 13:01:50 #3
 sarabjit   Member Since: August 2009    Total Comments: 12 

RE: Two numbers are entered through keyboard, write a program to find the value of one number raised to the power another.
 
#include<stdio.h>
int main()
{
int a,b,i,prod=1;
printf("Enter a number :");
scanf("%d",&a);
printf("Enter its power:");
scanf("%d",&b);
for(i=0;i<b;i++)
prod = prod*a;
printf("pow(a,b) = %d", prod);
getch();
return 0;
}
     

 

Back To Question