Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
Loading...
Searching...
No Matches
sol.c File Reference

Problem 6 solution More...

#include <stdio.h>
Include dependency graph for sol.c:

Functions

int main (void)
 Main function. More...
 

Detailed Description

Problem 6 solution

Function Documentation

◆ main()

int main ( void  )

Main function.

9{
10 unsigned s1 = 0, s2 = 0, i;
11 for (i = 1; i <= 100; i++)
12 {
13 s1 += i * i;
14 s2 += i;
15 }
16 unsigned ans = s2 * s2 - s1;
17 printf("%u\n", ans);
18 return 0;
19}