|   |  | 
| ปรับปรุง : 2564-07-13 (ปรับแฟ้ม) | 
| datatype | TurboC | Programming | 
| // array int, for<br>กำหนดค่าให้อาเรย์ และนำมาแสดง พร้อมหาค่า max
/* http://www.thaiall.com/tc */
#include <iostream.h>
#include <conio.h>
void main()
{
  clrscr();
  int x[5]={3,12,22,8,16};
  int max=0;
  for (int i=0;i<5;i++) {
    if (max < x[i]) max = x[i];
  }
  cout << "Max = " << max;
  getch();
}
 | 
| 
 | 
| "ไม่เริ่มต้นในวันนี้ จะไม่มีทางสำเร็จในวันพรุ่ง" โดย โยฮัน ว็อล์ฟกัง ฟ็อน เกอเทอ |