Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ The array of C language     - Actual custom yum repository ---- gem commands commonly used parameters (Linux)

- Elementary OS Freya global menu (Linux)

- Production environment Linux bonding method standby mode slave card switch (Server)

- Save the database data files into Oracle Learning (Database)

- How to Install Redis server on CentOS 7 (Server)

- Linux and Unix systems really do network more secure (Linux)

- DRBD installation configuration, working principle and Recovery (Server)

- Graphical development environment to build Android under Ubuntu 11.04 (Linux)

- How to track performance issues when using the Unity Game Development Android (Programming)

- Linux server security - the web server configuration (Linux)

- Linux upgrade GCC 4.8.1 clear and concise tutorials (Ubuntu 12.04 64-bit version as an example) (Linux)

- To install Xen in Ubuntu 12.04 (Linux)

- Kickstart automated installation and deployment RHEL 7.0 (Linux)

- Linux character device - user mode and kernel mode data transfer data (Linux)

- MySQL master-slave database configuration and error handling Raiders (Database)

- openSUSE 13.1 / 13.2 installation SoundConverter 2.1.2 (Linux)

- java.net.NoRouteToHostException of Hadoop problem: no route to host (Server)

- The Zabbix2.4.5 source compiler installation under Ubuntu 14.04 (Server)

- How to upgrade to Ubuntu 14.04 Ubuntu 14.10 (Linux)

- Linux alpine use the command line to access Gmail (Linux)

 
         
  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:      
 
- Ubuntu 14.04.1 LTS compile and install the new kernel (Linux)
- The source code compiler installation Nginx 1.8.0 under Ubuntu 14.10 (Server)
- Installation of JDK and Tomcat under Linux (CentOS) (Linux)
- quotacheck command file can not be created aquota.user and aquota.group solutions (Linux)
- Oracle Linux 6.4 (BOND) dual NIC teaming combat - Annotated (Linux)
- Save the database data files into Oracle Learning (Database)
- How to contribute code on GitHub uploads (Linux)
- Arrow keys, backspace key garbled in Python-2.7.5 Interactive Mode under CentOS 5.8 (Linux)
- CentOS 7 install Hadoop-cdh-2.6 (Server)
- Openfire achieve load balancing cluster by Nginx (Server)
- osprofiler use OpenStack Cinder Lane (Server)
- C language macro definition #define Usage (Programming)
- php security study (Linux)
- Linux boot process (Linux)
- Ubuntu How to install and upgrade Linux Kernel 3.15 (Linux)
- In the case of using cgroups Ubuntu 14.04 and Docker (Linux)
- Linux installation is larger than 2TB (UEFI interface) hard disk solution (Linux)
- When Vim create Python scripts, vim autocomplete interpreter and encoding method (Programming)
- grep search from files and display the file name (Linux)
- Briefly explain the invasion of the four-level denial of service attack DoS Linux server (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.