View Code of Problem 71

#include<>stdio.h
int main(void)
{
  int a=1,b=2,c,i,N;
  double sum;
  scanf("%d",N);
  while(i<=N)
  {
    sum+=b/a;
    c=b;
    b=a+b;
    a=c;
    i++;
  }
}
/*
Main.c:1:11: warning: extra tokens at end of #include directive
 #include<>stdio.h
           ^
Main.c:1:9: error: empty filename in #include
 #include<>stdio.h
         ^
Main.c: In function 'main':
Main.c:6:3: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   scanf("%d",N);
   ^
Main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf'
Main.c:6:3: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
*/

Double click to view unformatted code.


Back to problem 71