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
Are negative numbers true in c?
What is sizeof c?
What the advantages of using Unions?
Write a program which returns the first non repetitive character in the string?
How macro execution is faster than function ?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Why main is used in c?
Why should I use standard library functions instead of writing my own?
Can we use visual studio for c?
Why is c not oop?
Sir i need notes for structure,functions,pointers in c language can you help me please
How can you be sure that a program follows the ANSI C standard?
What is the use of function overloading in C?
How to set file pointer to beginning c?