Advertisement
dllbridge

Untitled

Nov 15th, 2023
774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.37 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8. #include <stdio.h>
  9.  
  10. ///////////////////////////////////////////////////
  11. struct TT
  12. {
  13.    
  14.     int nYear;
  15.    
  16.     float  fH;
  17.  
  18. }Dima, s[44];
  19.  
  20.  
  21.  
  22. ///////////////////////////////////////////////////
  23. int main()
  24. {
  25.    
  26.    
  27.  
  28.    
  29.     Dima.nYear = 1973 ;
  30.     Dima.fH    = 184.7;
  31.        
  32. //  printf("size of Dima = %d\n", sizeof(Dima));
  33.    
  34.     printf("nYear = %d, fH = %.2f\n", Dima.nYear, Dima.fH);  
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. /*
  66. #include <stdio.h>
  67.  
  68.  
  69.  
  70. ///////////////////////////////////////////////////
  71. int main()
  72. {
  73.    
  74.     double h = 1.00,
  75.            s = 0.01,
  76.            t       ;
  77.    
  78.     for (int i = 0; i < 365; i++)
  79.     {
  80.  
  81.         printf("day %d  - ", i);
  82.         t = h * s;
  83.         h = t + h;
  84.         printf("%.2f\n", h);
  85.    
  86.     }
  87.  
  88. }
  89.  
  90.  
  91. */
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. /*
  113.  
  114. #include <stdio.h>
  115.  
  116.  
  117.    
  118. void foo(int*);
  119.    
  120.  
  121.  
  122.  
  123. ////////////////////////////////////////////////////////
  124. int main()
  125. {
  126.    
  127.     int n = 77;
  128.        
  129.     printf("        n = %d\n  ",   n );      
  130.     printf("address n = %d\n\n",  &n );    
  131.    
  132.     foo(&n);  
  133.    
  134.     printf("        n = %d\n",     n );      
  135.     printf("address n = %d\n",    &n );
  136. }
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. /////////////////////////////////////////////////////  
  144. void foo(int *p)
  145. {
  146.    
  147.     int &n = *p;
  148.    
  149.     n = n - 20;
  150.     printf("        n2 = %d\n  ",   n );      
  151.     printf("address n2 = %d\n\n",   p );           
  152.            
  153. }
  154.  
  155.  
  156. */
  157.  
  158.  
  159.  
  160. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement