Advertisement
dllbridge

Untitled

Apr 26th, 2023
1,159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.03 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6.  
  7. int n = 96;
  8.  
  9. int    Max(int,  int);
  10.  
  11.  
  12. int (*min)(int, int) = Max;
  13.  
  14. //////////////////////////////////////////
  15. int main()
  16. {
  17.    
  18.     printf(" Max = %d\n",   Max);
  19.     printf(" min = %d\n",   min);    
  20.     printf("&min = %d\n",  &min);
  21.    
  22.     n = min(-7, 5);
  23.    
  24.     printf("Max = %2d\n", n);    
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. //////////////////////////////////////////////////////
  33. int Max(int n1, int n2)
  34. {
  35.    
  36.    
  37.     if(n1 > n2) return n1;
  38.  
  39. return  n2;
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. /*
  50. #include <stdio.h>
  51.  
  52. #define ODIN 111
  53.  
  54. int n = 96,
  55.     a[33];
  56.  
  57. int    Max(int,  int);
  58.  
  59.  
  60. //////////////////////////////////////////
  61. int main()
  62. {
  63.    
  64.     printf("&Max = %d\n",  ODIN);
  65.  
  66. }
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. //////////////////////////////////////////////////////
  74. int Max(int n1, int n2)
  75. {
  76.    
  77.    
  78.     if(n1 > n2) return n1;
  79.  
  80. return  n2;
  81. }
  82.  
  83.  
  84.  
  85. */
  86. /*
  87.  
  88.    
  89.     n = Max(7, 5);
  90.    
  91.     printf("Max = %2d\n", n);
  92.    
  93.     float f = Max(1.5, 5.8);
  94.    
  95.     printf("Max = %.1f\n", f); 
  96.     */
  97.  
  98.  
  99. /*
  100. #include <stdio.h>
  101.  
  102.  
  103. int n = 96;
  104.  
  105. int    Max(   int,    int);
  106. double Max(double, double);
  107.  
  108. //////////////////////////////////////////
  109. int main()
  110. {
  111.    
  112.    
  113.     n = Max(7, 5);
  114.    
  115.     printf("Max = %2d\n", n);
  116.    
  117.     float f = Max(1.5, 5.8);
  118.    
  119.     printf("Max = %.1f\n", f); 
  120. }
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. //////////////////////////////////////////////////////
  128. int Max(int n1, int n2)
  129. {
  130.    
  131.    
  132.     if(n1 > n2) return n1;
  133.  
  134. return  n2;
  135. }
  136.  
  137.  
  138.  
  139.  
  140. //////////////////////////////////////////////////////
  141. double Max(double f1, double f2)
  142. {
  143.    
  144.    
  145.     if(f1 > f2) return f1;
  146.  
  147. return  f2;
  148. }
  149.  
  150. */
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171. /*
  172.  
  173. #include <stdio.h>
  174.  
  175.  
  176. int n = 96;
  177.  
  178. //////////////////////////////////////////
  179. int main()
  180. {
  181.    
  182.     n = n >> 5;
  183.    
  184.     printf("%2d ", n);
  185. }
  186.  
  187.  
  188.  
  189. */
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214. /*
  215. #include <stdio.h>
  216. using namespace std;
  217.  
  218.  
  219. int main()
  220. {
  221.     int a[2][10];
  222.  
  223.     for (int i = 0; i < 20; ++i)
  224.     {
  225.         a[0][i] = 1;
  226.        
  227.         if(i >  8)
  228.         if(i < 11)  a[0][i] = i;
  229.        
  230.     }
  231.  
  232.     for (int j = 0; j < 20; ++j)
  233.     {
  234.         printf("%2d ", a[0][j]);
  235.  
  236.         if (j == 9)  printf("\n");
  237.     }
  238.     printf("\n");
  239.  
  240. }
  241.  
  242.  
  243.  
  244.  
  245. */
  246.  
  247.  
  248.  
  249. /*
  250. /////////////////////////////////////////////////////////////////////
  251. int main()
  252. {
  253.    
  254.     int a[2][10];
  255.    
  256.     for(int i = 0; i < 2; ++i)
  257.     {  
  258.         for (int j = 0; j < 10; ++j)    
  259.         {
  260.             a[i][j] = 1;
  261.         }
  262.            
  263.     }
  264.    
  265.     a[1][0] = 10;
  266.     a[0][9] =  9;
  267.  
  268.  
  269.      
  270.     for(int j = 0; j < 20; ++j)
  271.     {
  272.         printf("%2d ", a[0][j]);
  273.        
  274.         if(j == 9)  printf("\n");
  275.     }
  276.     printf("\n");
  277.  
  278. }
  279.  
  280. */
  281.  
  282.  
  283.  
  284.  
  285. /*
  286.  
  287. #include <stdio.h>
  288. using namespace std;
  289.  
  290.  
  291. /////////////////////////////////////////////////////////////////////
  292. int main()
  293. {
  294.     int a[2][10];
  295.    
  296.     for(int i = 0; i < 2; ++i)
  297.     {  
  298.         for (int j = 0; j < 10; ++j)    
  299.         {
  300.             a[i][j] = 1;
  301.         }
  302.            
  303.     }
  304.    
  305.     a[1][0] = 10;
  306.     a[0][9] =  9;
  307.  
  308.  
  309.     for(int i = 0; i < 2; ++i)
  310.     {  
  311.         for(int j = 0; j < 10; ++j)
  312.         {
  313.             printf("%2d ", a[i][j]);
  314.         }
  315.         printf("\n");
  316.     }
  317. }
  318.  
  319.  
  320. */
  321.  
  322.  
  323.  
  324.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement