GeekInterview.com
Series: Subject: Topic:
Question: 166 of 589

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

This question is related to Aztec-Systems Interview
Asked by: Interview Candidate | Asked on: Oct 28th, 2007
Showing Answers 1 - 5 of 5 Answers
tarun00000

Answered On : Oct 25th, 2008

View all answers by tarun00000

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("enter two no.:");
scanf("%d%d",&a,&b);
c=a+b;
pritf("sum of no.is=%d",c);
getch();
}

  
Login to rate this answer.
terna_engg

Answered On : Oct 13th, 2009

View all answers by terna_engg

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int a,b;
printf("enter the 2 nos:");
scanf("%d",&a,&b);
pow(a,b);
getch();
)
pow(a,b0
{
return(a^b);
}

  
Login to rate this answer.
sarabjit

Answered On : Oct 14th, 2009

View all answers by sarabjit

#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;
}

  
Login to rate this answer.
jechanter

Answered On : Feb 8th, 2010

View all answers by jechanter

main()
{
        scanf("%d",&a); // base
         scanf("%d",&b); //power
         for(int i=0;i<b;i++)
             a=a*b;
        printf("result is..%d",a);
}

  
Login to rate this answer.
Shivam

Answered On : Jul 15th, 2013

Code
  1. #include<conio.h>
  2. #include<stdio.h>
  3. #include<math.h>
  4. main()
  5. {
  6.     int a,b,num,i;
  7.     printf("enter the number ");
  8.     scanf("%d",&a);
  9.     printf("enter the number  in power");
  10.     scanf("%d" , &b);
  11.   num = pow(a,b);
  12.  
  13.    printf("%d" , num);
  14.     getch();
  15. }

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.