Sum of N Numbers Program In C: Using Functions

Let’s have a look at the Sum of N Numbers Program In C Using Functions allows the user to enter N integer by using the function.

In C Programming Language, a function is combined with a block of code that can be called or used anywhere in the program by calling the name.

Body of a function starts with{ and ends with } . This is similar to the main function.

C Program To Find Sum of N Numbers Using Functions

/* Learn C Programming at */
int Sum_Functions(int N);

int main()
  int N, i, Sum = 0;
  printf("\nPlease Enter any Integer of your choice\n");
  scanf("%d", &N);
  Sum = Sum_Functions(N);
  printf("Sum= %d", Sum);
  return 0;

int Sum_Functions(int N)
	int i, Sum = 0;
	if (N == 0)
		return N;
		return (N* (N + 1) / 2);


Please Enter any Integer of your choice


Sum= 6


Leave a Comment

Your email address will not be published. Required fields are marked *