>while (5 == 5) {
This is strange. Not only that you used <constant> == <constant>, but because you chose 5 as the constant. A more conventional way to create an infinite while loop is
while ( 1 ) {
/* Body */
} >SUM (int res);
A function call does not declare parameters, it takes arguments:
Here is the same program with the necessary fixes:
#include <stdio.h>
int SUM (int n1, int n2);
int main ()
{
int n1, n2, i;
while (1) {
printf ("To close the program, type 0: ");
scanf ("%d", &i);
if (i == 0) break;
printf ("Type the numbers that should be used to do the sum: ");
scanf ("%d %d", &n1, &n2);
SUM (n1, n2);
}
}
int SUM (int n1, int n2)
{
int res;
res = n1 + n2;
printf ("The result is: %d", res);
return res;
}