answersLogoWhite

0

#include <stdio.h>

int main()

{

int a, b,i,ans;

printf("Enter a and b\t");

scanf("%d %d",&a,&b);

ans=1;

for(i=0;i<b;i++)

ans=ans*a;

printf("%d to the power %d = %d",a,b,ans);

return 0;

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write a 'c' program to fine a largest of three numbers?

largest of a, b, c :a > b ? a > c ? a : c : b > c ? b : c


What is XOR in a c program?

a XOR b is a^b in C language


Recursive program for a power b in c language?

int pow (int a, int b) { if (b==0) return 1; else return a*pow(a,b-1); }


Write a Program in lisp to find maximum of three numbers?

(defun max3 (a b c) (cond ((&gt; a b) (cond ((&gt; a c) a) (t c))) ((&gt; b c) b) (t c) ) )


What is the answers to the primary research program?

D C B A C D A C C A B is all I know 2012 Australia


C program to find largest among three numbers?

#define max2(a,b) (b&gt;a?b:a) #define max3(a,b,c) (max2(a,max(b,c)))


What is the Simple definition of power in c basic program?

A mathematical function declared in math.h: double pow (double b, double q);


Program OF A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A?

Rebound central 7 (G), rebound double 6 (F), rebound double 5 (E). Is this a countdown program? Seems to be missing the central 6 (F).


C program to find the largest among three numbers using ternary operator?

max = a &gt; b ? a : b; max = max &gt; c ? max : c;


Is there a c program to generate the series a a b a b c?

You need to be more specific in what you are asking. For example, the following meets your requirements: int main() { printf("a a b a b c\n"); return 0; }


Addition of two numbers on plsql program?

--THE SUM OF TWO NUMBERS: declare a number(2); b number(2); c number(2); begin a:=&amp;a; b:=&amp;b; c:=a+b; dbms_output.put_line(a ' + 'b' = 'c); end;


Write a c plus plus program to find the largest among three numbers using ternary operators?

R = (A &gt; B &amp;&amp; A &gt; C) ? A : (B &gt; C) ? B : C; // parentheses not necessary - for clarity only