Write a program that takes a 5 digit number and calculates 2
power that number and prints it

Answer Posted / manish soni bca 3rd year jaipu

#include<stdio.h>
#include<conio.h>
void main()
{
int n,p;
long int ans;
printf("Enter the number ans power");
scanf("%d %d",&n,&p);
ans=1;
while(p>0)
{
ans*=n;
p--;
}
printf("%ld",ans);
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I remove the trailing spaces from a string?

618


What is logical error?

606


How do I copy files?

626


Who invented bcpl language?

709


What is a null pointer in c?

602






Why c is known as a mother language?

650


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1851


What are the types of macro formats?

613


Is c object oriented?

544


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

605


What is the process to generate random numbers in c programming language?

616


Linked list is a Linear or non linear explain if linear how it working as a non linear data structures

1767


What is the data segment that is followed by c?

617


Differentiate between ordinary variable and pointer in c.

625


What is a newline escape sequence?

669