C-Programming

Program to display sum of series 1+1/2+1/3+…+1/n in C language

The following C program is to find the sum of the series 1+1/2+1/3+…+1/n. The following code have been compiled and executed in Dev C++. Information about the code:  > The variable is taken as double here. Int datatype will not be used here or else the generated output will be wrong. > %.3lf prints 3

%d bloggers like this: