15-Write a C program to calculate the power of a number.

Program: 15

Write a C program to calculate the power of a number.

#include
#include
void main()
{
    int a, b;
    long s;
    printf("Enter any number: ");
    scanf("%d", &a);
    printf("Enter power: ");
    scanf("%d", &b);
    s=pow(a,b);
    printf("%ld", s);
    getch();
}
Output
Enter any number: 3

Enter power: 2

9

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.