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

Answers were Sorted based on User's Feedback



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

Answer / venkataramakrishna.danduri

#include <iostream.h>

void main()
{
int b = 0;
int num5digit;
cin>>num5digit;
b = 1<< num5digit;
cout<<"b = "<<b;
}

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kathir

#include<iostream.h>
void main()
{
int a,n=0;
cout<<"Enter the 5 didgit no:"<<endl;
cin>>a;
n=(a*a);
cout<<"The two power given no is:"<<n<<endl;

}

Is This Answer Correct ?    4 Yes 6 No

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

Answer / 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

More C++ General Interview Questions

Can we distribute function templates and class templates in object libraries?

0 Answers  


what is data abstraction in C++?

0 Answers  


What is atoi?

0 Answers  


What is meant by forward referencing and when should it be used?

0 Answers  


What return value must conversion operators have in their declaration?

0 Answers  






sizeof- is it functioning statically or dynamically?

2 Answers  


Describe new operator?

0 Answers  


What is string in c++ programming?

0 Answers  


Explain function overloading

0 Answers  


How do we balance an AVL Tree in C++?

0 Answers   Impetus,


What does namespace mean in c++?

0 Answers  


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

0 Answers  


Categories