Professional Documents
Culture Documents
Problema 2
Problema 2
#include <stdio.h>
#include <math.h>
int main()
{
int N;
float s = 0;
return 0;
}
//utilizand while
#include <stdio.h>
#include <math.h>
int main()
{
int N;
float s = 0;
int i = 0;
while(i < N) {
s += pow(i + 1, N - i);
i++;
}
return 0;
}
//do-while
#include <stdio.h>
#include <math.h>
int main()
{
int N;
float s = 0;
int i = 0;
do {
s += pow(i + 1, N - i);
i++;
}while(i < N);
return 0;
}