%  SAMPLE ALGORITHM TO SUM N NUMBERS
% 
%  Add N numbers together:
% 
%  INPUT:   Number of numbers to sum N;
%           Numbers x1,...,xn to sum
% 
%  OUTPUT:  Sum of the N numbers.
 fprintf(1,'Add up N numbers\n');
 tot = 0;
 fprintf(1,'Input the number of numbers N\n');
 N = input(' ');
 for i = 1:1:N
     X = input('Enter next number in sum: ');
     tot = tot + X;
 end
 % procedure completed successfully
 fprintf(1,'\nSUM = %11.8f \n',tot);
 
 
