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
How can I remove the trailing spaces from a string?
What is logical error?
How do I copy files?
Who invented bcpl language?
What is a null pointer in c?
Why c is known as a mother language?
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 []);
What are the types of macro formats?
Is c object oriented?
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?
What is the process to generate random numbers in c programming language?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What is the data segment that is followed by c?
Differentiate between ordinary variable and pointer in c.
What is a newline escape sequence?