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
1
Expert's answer
2012-11-27T09:52:59-0500
#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;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment