Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ The array of C language     - Source compiler install Nginx (Server)

- Eclipse remove all comments and code spaces (Linux)

- Linux System Getting Started Tutorial: Installing Git on Linux (Linux)

- Remote database using RMAN recovery test (RAC return to single-instance database) (Database)

- Tip: Use Cryptsetup U disk encryption (Linux)

- Mhddfs: multiple smaller partitions into one large virtual storage (Linux)

- Oracle table space is too large processing time (Database)

- Varnish configuration language VCL and its built-in variables (Server)

- Linux Network Statistics Tools / Command (Linux)

- CentOS 6.5 x86_64 system customized automated deployment (Linux)

- Node.js installed on Ubuntu Upstream version (Linux)

- Common Linux system performance monitoring command (Linux)

- Fedora 20, Fedora 19, CentOS 6 and RHEL6 users how to install Wine 1.7.15 (Linux)

- Wine 1.7 is installed on a system based on RedHat or Debian (Linux)

- CentOS6.x and Windows XP and Windows Server 2003 Open IPv6 related matters (Linux)

- Based Corosync + Pacemaker + DRBD + LNMP Web server to achieve high availability cluster (Server)

- ASP.NET 5 (vNext) Linux deployment (Server)

- Taught you how to install Ubuntu Linux (Linux)

- Why do I prefer Git (Linux)

- Achieve single backup of MySQL by innobackupex (Database)

 
         
  The array of C language
     
  Add Date : 2018-11-21      
         
         
         
  A one-dimensional array of C language

1, find the maximum and minimum values of a number of

     int age [5];
     float sum = 0;
    
     printf ( "Please enter the five integers: \ n");
     for (int i = 0; i <5; i ++) {
         scanf ( "% d", & age [i]);
     }
     int min = age [0];
     int max = age [0];
    
     for (int i = 1; i <5; i ++) {
         sum = sum + age [i];
         if (age [i]> max) {
             max = age [i];
         }
         if (age [i]              min = age [i];
         }
     }
     printf ( "max =% d \ n", max);
     printf ( "min =% d \ n", min);

2. Bubble Sort

  int arr [5] = {1,5,9,3,4}, t;
     for (int i = 0; i <4; i ++) {
         for (int j = 0; j <4-i; j ++) {
             if (arr [j]> arr [j + 1]) {
                 t = arr [j];
                 arr [j] = arr [j + 1];
                 arr [j + 1] = t;
             }
         }
     }
    
     for (int i = 0; i <5; i ++) {
         printf ( "% d \ t", arr [i]);
     }
     
         
         
         
  More:      
 
- React Getting Started Tutorial (Linux)
- Hyper-V virtual hard disk how to copy files to and attached to the virtual machine (Linux)
- Linux System Getting Started Tutorial: How to change the default Java version in Linux (Linux)
- open V switch port mirror in OpenStack neutron (Server)
- How to manage and use Logical Volume Management LVM in Ubuntu (Linux)
- Java framework for parallel study - ForkJoin (Programming)
- Java Collections Framework interfaces map (Programming)
- Node.js installed on Ubuntu Upstream version (Linux)
- Linux to achieve a simple cp command (Linux)
- What factors affect the performance of Java calls (Programming)
- Extended use of the swap file swap space on Linux (Linux)
- Ubuntu Server 14.04 installation Web server (Linux + Apache + MySQL + PHP) (Server)
- Linux kernel modules related to the management Comments (Linux)
- Linux basic introductory tutorial ---- Software Installation under Linux (Linux)
- Debian GNU / Linux service list acquisition, shutting down services or run (Linux)
- MySQL use the integer type (Database)
- Android Dynamic efficiency articles: a brilliant Loading Analysis and Implementation (Programming)
- Java polymorphic methods inside constructors complete analysis (Programming)
- Quota for Vsftpd do use disk quotas (Server)
- Java string intern constant pool resolution Introduction (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.