C Language exam computer 2020

 

 

 

 

 

 

 

 

 

 

[D] Design criteria partitioning software modules to be followed is highly cohesive coupling
engagement, the appropriate size of block size, and the like appropriate dependencies module. Module plan
division should follow certain requirements in order to ensure reasonable module division and further ensure that
as a basis to develop a software system reliability, easy to understand and maintain.
Should be as low as possible coupling between modules, module cohesion should be as
high.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

#include  <stdio.h>
double fun(double  e)
{ int  i, k;    double  s, t, x;
  s=0;  k=1;  i=2;
/**********found**********/
  x=3.0/4;
/**********found**********/
  while(x > e)
  { s=s+k*x;
    k=k* (-1);
    t=2*i;
/**********found**********/
    x=(t+1)/(t*t);
    i++;
  }
  return  s;
}
main()
{ double  e=1e-3;
  printf("\nThe result is: %f\n",fun(e));
}

 

 

 

 

 

 

#include <stdio.h>

/************found************/
double fun (  int  n )
{   int  a, b, c, k;  double  s;
    s = 0.0;  a = 2;  b = 1;
    for ( k = 1; k <= n; k++ ) {
/************found************/
      s = s + (double)a / b;
       c = a;  a = a + b; b = c;
    }
    return s;
}

main( )
{   int   n = 5;
    printf( "\nThe value of  function is: %lf\n",  fun (  n ) );
}

 

 

 

 

 

 

 

 

#include <stdio.h>
#define M 4
int fun (int a[][M])
{
int i,j,max=a[0][0];
  for(i=0;i<2;i++)
     for(j=0;j<M;j++)
        if(max<a[i][j]) 
           max=a[i][j];
  return max;
}

main( )
{  int arr[2][M]={5,8,3,45,76 , - . 4 , 12 is , 82 }; void NONO (); 
   the printf ( " max D =% \ n- " , Fun (ARR)); 
   NONO (); 
} 

void NONO () 
{ / * This function opens the file , input data, function calls, output data, close the file. * / 
  The FILE * WF;
   int ARR [] [M] = { . 5 , . 8 , . 3 , 90 , 76 , - . 4 , 12 is , 82 }; 

  WF = the fopen ( " out.dat " ,"w") ;
  fprintf(wf, "max=%d\n", fun(arr)) ;
  fclose(wf) ;
}

 

Guess you like

Origin www.cnblogs.com/wlyperfect/p/12483718.html