Problem with the exercise "Difference of Squares" in the C track

I make the exercise first in VSC, then, when I wanted to run in exercism my code doesn’t work. Look my code.

#include<stdio.h>

int main(void)
{

    unsigned int sum_of_squares (unsigned int number);
    int sum = 0;
    int sumofs = 0;
    for(int i = 1; i <= 10; i++)
    {
    printf("sum of squares: %u\n", sumofs += i * i );
    }

    for(int i = 1; i <= 10; i++)
    {
        printf("sum of number: %d\n",sum += i);
    }

    unsigned int square_of_sum(unsigned int number);

    printf("square of sum: %u\n", sum * sum);


    unsigned int difference_of_squares(unsigned int number);

    printf("difference of squares: %u\n", (sum * sum) - sumofs ) ;

    return 0;
}

What’s the error message you’re seeing?

Are you running the Exercism tests locally? Testing on the C track | Exercism's Docs

What is this line supposed to do?

No, I’m running the exercism editor from the web

With that function I have the sum of squares of the first N numbers from 1 to 10

That’s not how functions are defined in C :slightly_smiling_face:

How should I define the functions? I’m a beginner

Thank you very much

1 Like