Advertisement
dllbridge

Untitled

Feb 25th, 2023
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.15 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. int  n = 2;
  7.  
  8. int *p = &n;
  9.  
  10. //////////////////////////////////////////////////////////////                                                            //
  11. int main()
  12. {
  13.  
  14.  
  15.        
  16.     printf(" n = %2d \n",  n);
  17.     printf(" p = %2d \n",  p);
  18.     printf("&n = %2d \n", &n); 
  19.     printf("*p = %2d \n", *p);
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. /*
  38.  
  39. #include <stdio.h>
  40.  
  41.  
  42. int  n = 2;
  43.  
  44.  
  45. //////////////////////////////////////////////////////////////                                                            //
  46. int main()
  47. {
  48.     int i = 1;
  49.  
  50.  
  51. L_01:      
  52.         printf("%d * %d = %2d \n", i, n, i*n);
  53.        
  54.         i++;
  55.        
  56.         if(i < 10) goto L_01;
  57.    
  58.  
  59. }
  60.  
  61.  
  62.  
  63. */
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. /*
  81.  
  82. #include <stdio.h>
  83.  
  84.  
  85. int  nMonth = 26;
  86.  
  87.  
  88. //////////////////////////////////////////////////////////////                                                            //
  89. int main()
  90. {
  91.     if(nMonth >  0)
  92.     if(nMonth < 13)
  93.     {
  94.       if(nMonth == 5)  printf("May \n");   
  95.       if(nMonth == 6)  printf("June\n");   
  96.    
  97.     } else printf("Error\n");
  98.  
  99. }
  100.  
  101.  
  102. */
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. //    if(nMonth < 1 || nMonth > 12) printf("Error\n");  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125. /*
  126.     switch(nMonth)
  127.     {
  128.        
  129.        case  5: printf("May\n");
  130.                 break;  
  131.        
  132.        case  6: printf("June\n");
  133.                 break;  
  134.                
  135.                
  136.        default: printf("Error\n");                 
  137.     }
  138.    
  139.  
  140. */
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  /*
  155. int  nMonth = 5;
  156.  
  157.  
  158. //////////////////////////////////////////////////////////////                                                            //
  159. int main()
  160. {
  161.    
  162.     int n = 54;
  163.    
  164.     int ost = n%7;
  165.    
  166.     printf("ost = %d\n", ost);
  167.    
  168. }
  169.  
  170.  
  171.  
  172. */
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. /*
  188.  
  189. #include <stdio.h>
  190.  
  191.  
  192. int  nMonth = 5;
  193.  
  194.  
  195. //////////////////////////////////////////////////////////////                                                            //
  196. int main()
  197. {
  198.    
  199.    
  200. //  if(nMonth == 5) printf("May\n");
  201. //  if(nMonth == 6) printf("Junr\n");  
  202.    
  203.    
  204.     switch(nMonth)
  205.     {
  206.        
  207.        case  5: printf("May\n");
  208.                 break;  
  209.        
  210.        case  6: printf("June\n");
  211.                 break;  
  212.                
  213.                
  214.        default: printf("Error\n");                 
  215.     }
  216.    
  217.    
  218.    
  219. }
  220.  
  221. */
  222.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement