include stdio include conio include math include iostream void main in

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <iostream>
void main()
{
int N, stepA = 1;
float a;
float S = 0;
printf("%s", "Enter :\n");
scanf_s("%d", &N);
for (int i=1; i<=N; i++)
{
if (i%2 == 0) {float(a) == i;}
if (i%2 != 0) {float(a) == i*(i-2);}
S+= pow((float(a)-i), 2);
}
printf("S = %f", S);
getch();
}