#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a,t,t1;
cout<<"Enter the number: ";
cin>>a;
for(int n=1;n<=a;n++ )
{
t=pow(n,n);
t1=t1+t;
}
cout<<t1;
return 0;
}
#include<cmath>
using namespace std;
int main()
{
int a,t,t1;
cout<<"Enter the number: ";
cin>>a;
for(int n=1;n<=a;n++ )
{
t=pow(n,n);
t1=t1+t;
}
cout<<t1;
return 0;
}
No comments :
Post a Comment