write a program that takes 5 digit no and calculate 2 power
that no and print it.

Answer Posted / yeah

#include<iostream.h>
#include<math.h>
void main()
{
int a,n=1,i;
cout<<"enter Num";
cin>>a;
//n=pow(2,a);
for(i=0;i<a;i++)
n*=2;
cout<<n;
}

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.

630


What does the nocreate and noreplace flag ensure when they are used for opening a file?

676


What is abstraction c++?

589


What is the insertion operator and what does it do?

563


What are pointer-to-members? Explain.

630






What does it mean to declare a member variable as static?

612


What does namespace mean in c++?

555


What is the use of endl in c++?

593


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

1005


Is python written in c or c++?

622


How do c++ struct differs from the c++ class?

592


How do you define a class in c++?

642


What is c++ redistributable?

621


Is c++ low level?

578


Should I learn c or c++ or c#?

557