Computer Science, asked by rushikeshdhage582000, 9 months ago

Write a VB program to calculate x^y without using built-in function​

Answers

Answered by sunilsidu
1

Explanation:

#include<stdio.h>

#include<conio.h>

void main()

{

int x,y,i,r=1,t;

printf("Enter a number:");

scanf("%d",&x);

printf("Enter the power:");

scanf("%d",&y);

for(i=1;i<=y;i++)

{

t=x;

r=r*t;

}

printf("Result:%d",r);

getch();

}

Output:

Enter a number:5

Enter the power:3

Result:125

Similar questions