write a program that a 5 digit number and calculates 2
power that number and prints it.

Answer Posted / ayushi rastogi

/* We assume that user enter 5 digit No */

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
double No,length=2;
double pwrNo;
printf("Please Enter the 5 digit No.:");
printf("\n");
scanf("%d",&No);
pwrNo=pow(No,2);
printf("\n");
printf("Power of %u No is %u",No,pwrNo);

}

Is This Answer Correct ?    6 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c++ vector a linked list?

647


What are c++ templates used for?

713


Implement stack operations with pointers with appropriate exception checks.

653


How do you define a class in c++?

722


What is a syntax in c++?

718






Are iterators pointers?

773


Should the this pointer can be used in the constructor?

645


Can you write a function similar to printf()?

751


what are Operators and explain with an example?

828


Why the usage of pointers in C++ is not recommended ?

984


What are namespaces in c++?

697


What is the difference between while and do while loop? Explain with examples.

688


Does c++ have finally?

651


What jobs can you get with a c++ certification?

678


Difference between pointer to constant vs. Pointer constant

700