Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ The array of C language     - CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)

- 10 useful tools for Linux users (Linux)

- CentOS 6.5 Linux System Customization and Packaging Quick Implementation Script (Linux)

- PostgreSQL with the C Completing the storage process instances (Database)

- Database Blob data type conversion String (Programming)

- shell script: a key to install LAMP, LNMP script (Server)

- Linux environment password security settings (Linux)

- Oracle and MySQL difference between the jdbc (Database)

- MongoDB learning Notes (2) basic connection example of -Nodejs and MongoDB (Database)

- Linux use logs to troubleshoot (Linux)

- CentOS and RHEL to install IPython 0.11 (Linux)

- Asynchronous JavaScript loading (Programming)

- Job achieve automation in Ubuntu 14.04 - Using Cron (Linux)

- Confrontation dragged Library - Web front-end encryption slow (Linux)

- Experience CoreCLR stack unwinding characteristics of initial implementation on Linux / Mac (Linux)

- Build the first ASP.NET 5 Web project in Mac OS X Yosemite 10.10.3 (Server)

- Linux reserves the rest of the file to delete several (Linux)

- Pydev installed and configured on the Eclipse (Linux)

- The specified user to execute commands under Linux (Linux)

- How to Create a file can not be changed under Linux (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:      
 
- MySQL can not write the data keyword conflicts (Database)
- Java thread lifecycle (Programming)
- How to modify the Ubuntu terminal user name changed to red color (Linux)
- Oracle local user login authentication fails ORA-01031 insufficient privileges (Database)
- Java, boolean operators & =, | = ^ = use (Programming)
- VMware clone Linux find eth0 (Linux)
- MyCAT separate read and write to achieve MySQL Practice (Database)
- ORA-00824: can not set sga_target due to existing problem-solving (Database)
- Installation and Configuration JDK8 In CentOS 7 (Linux)
- Linux operation and maintenance of the automated installation and deployment RHEL7.0 Cobbler (Linux)
- Handle large data problems Bit-map method (Programming)
- Verify the character set on MyCAT (Database)
- Through Oracle to help restore MySQL data problems (Database)
- Some common regular expressions (Linux)
- SecureCRT 7.0 Log Ubuntu 12.04 server via SSH service under Vmware (Server)
- OpenGL Superb Learning Notes - New Patterns (Programming)
- installation and configuration of the PHP environment (Apache2) under Linux (Server)
- Find details block device with Linux blkid command (Linux)
- VMware 8 installation configuration Win7, CentOS-7 Wizard (Linux)
- Linux / proc directory Comments (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.