Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Home Community Write a C program (WAC) to calculate the value of a number …

Write a C program (WAC) to calculate the value of a number raised to a given power using while loop.

Soham  •  Jul 21, 2026  •  2 views
1

1 Answers

Soham
Jul 21, 2026
#include<stdio.h>
int main(){
int i=1,b,p,res=1;
printf("Enter Number: ");
scanf("%d",&b);
printf("Enter Power: ");
scanf("%d",&p);

while(i<=p){
res=res*b;
i++;
}
printf("%d",res);
return 0;
}

Your Answer

Will not be displayed publicly
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →