View Code of Problem 48

#include <stdio.h>
#include <math.h>
int main(){
 int a,i,b;
 double s=0.0,qmu,mu=2.0,zi=1.0;
  scanf("%d",&a);
  for(i=1;i<=a;i++){
	 s+=mu/zi;
	 qmu = mu; 
	 mu=mu+zi;
	 zi = qmu;
	
	
  }
  printf("%1.6lf",s);

  return 0;
 }

Double click to view unformatted code.


Back to problem 48