A number and power to be calculated is taken from user.Power is calculated.
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- int n,x,y=1;
- cout<<"Please enter x: ";
- cin>>x;
- cout<<"Please enter n: ";
- cin>>n;
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- for (int i=1;i<=n;i++)
- y=y*x;
- cout<<y;
- getch();
- }
0 comments:
Post a Comment