60 478
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #19553 in C++ for mounisha

Question #19553
write a c++ program 1)that calculates and prints sum of integers from 1 to 10
2)to calculate x raised to the power y
Expert's answer
#include "iostream"
using namespace std;

int main()
{ int s=0;
& for(int i=1;i<11;i++)
& s+=i;
cout<<" sum of integers from 1 to 10 : "<<s<<endl;

system ("PAUSE");

}








#include "iostream"
using namespace std;

int main()
{ int x,y,s=1;
cout<<"Enter X: ";
cin>>x ;
cout<<"Enter Y: ";
cin>>y;
for (int i=1;i<(y+1);i++)
s*=x;
cout<<"X raised to the power Y : "<<s<<endl;

system ("PAUSE");

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions