SlideShare a Scribd company logo
1 of 18
Exam 01
ลำดับการทำงานของ   Operator ลำดับความสำคัญจากสูงไปต่ำ โอเปอเรเตอร์ ( ) ++, -- -( เครื่องหมายลบหน้าตัวเลข ) * ,  /  , % +  ,  -
จากโปรแกรมด้านล่างนี้ คำตอบที่ได้ ค่า  i  คืออะไร  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],i = j+(k=3)*5; i = 5+(3*5); i = 3+15; i=20 ;
จงหาค่าที่คำนวณได้ดังต่อไปนี้ ,[object Object],(-5*( 64 )+7)-4%10*2 ( 320  +7)-4%10*2 ( -313 )- 4 *2 -313- 8  =-321
[object Object],[object Object],[object Object],[object Object],จงหาค่าที่คำนวณได้ดังต่อไปนี้
[object Object],[object Object],[object Object],[object Object],จงหาค่าที่คำนวณได้ดังต่อไปนี้ กำหนดให้  a = 7  b=5  c=3  d=6 -10+(++ 7 )-7+3*2%7*2 -10+( 8 )-7+ 6 *2 -10+( 8 )-7+ 12 -2 -7+ 12  =3
[object Object],[object Object],[object Object],[object Object],จงหาค่าที่คำนวณได้ดังต่อไปนี้ กำหนดให้  a = 7  b=5  c=3  d=6   ++b+d--%2*(++c*4-1)/2   ++5 + 6 --%2*(++ 3 *4-1)/2   6 + 6 --%2*( 4 *4-1)/2  =>>  6--%2 =0 ( ทำ  6%2  ก่อน แล้วค่อยทำ  6++  หลังจากทำคำสั่งทั้งหมดเสร็จ )   6 + 0 *( 15 )/2   6-0/2  =  6
[object Object],[object Object],[object Object],[object Object],จงหาค่าที่คำนวณได้ดังต่อไปนี้ กำหนดให้  a = 7  b=5  c=3  d=6 2*5%3/2*(c++/2*d---8) ( c++  และ  d— จะทำหลังจากคำสั่งนี้ทำเสร็จ  ) 2*5%3/2*( 3 /2* 6 -8) 10 %3/2*( 1 * 6 - 7 ) 1 /2*( -1 ) 0*(-1)  = 0
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],10  7  16 9  6  3 ,[object Object],[object Object],[object Object]
คำสั่งในข้อใดที่ให้ผลลัพธ์เหมือนกัน  ,[object Object],[object Object],[object Object]
จากโปรแกรมถ้าป้อนค่า  9  เข้าไปผลลัพธ์ที่ได้ออกมาคืออะไร ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],  n=9 (9<=8 ?)  No=> n=n+2   n= 11 n>=11?  Yes =>n=n-2 n=9  n=n-1 = 8
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integer  เลขจำนวนเต็ม Type Signed Byte Lower upper shot int signed 2 (16 bit) -32,768 32,768 unsigned 2 (16 bit) 0 65535 Int (16bits) signed 2 (16 bit) -32,768 32,768 unsigned 2 (16 bit) 0 65535 Int (32 bits) signed 4 (32 bit) -2,147,483,648 2,147,483,647 unsigned 4 (32 bit) 0 4,294,967,295 long int signed 4 (32 bit) -2,147,483,648 2,147,483,647 unsigned 4 (32 bit) 0 4,294,967,295
Float  เลขทศนิยม -38 -308 -4932 38 308 4932 Character  ชนิดข้อมูลแบบอักษร ชนิดข้อมูลแบบอักษร คือข้อมูลประเภท  char  ซึ่งจะเก็บได้  1  ตัวอักษร เครื่องจะทำ การเก็บอยู่ในรูปของรหัส  Ascii   เช่น   A = 65  หรือ  0110 0001 Type Byte Lower Upper float 4 3.4 x 10 3.4 x 10 double 8 1.7x10 1.7x10 long double 10 3.4x10 3.4x10
Ascii code
Ascii code
การแปลงข้อมูล ,[object Object],[object Object],ชนิดของข้อมูล Long double นัยสำคัญสูงสุด นัยสำคัญต่ำสุด Double Float Unsigned long int Long in  Unsigned int Int Short char
Implicit Conversion ,[object Object],C = Int A  + float B การบวกตัวแปร  A  ที่มีชนิดเป็น  int  กับ  B  ที่มีชนิด เป็น  float  นั้นไม่สามารถทำได้ทันทีเพราะว่าเป็นตัวแปรต่างชนิดกัน แต่ภาษาซีจะทำการ แปลงชนิดของข้อมูลจาก  int  ไปเป็น  float   ( จากนัยต่ำกว่าไปสูงกว่า )  แล้วจึงทำการบวก โดยค่าซีที่ได้จะมีชนิดของข้อมูลเป็น  float นิพจน์ การแปลงชนิดข้อมูล char + float แปลง  char  ไปเป็น  float unsigned int – long int แปลง  unsigned int  ไปเป็น  long int float * double แปลง  float  ไปเป็น  double Int/ long double แปลง  int  ไปเป็น   long double (short + long) / double แปลง   short  ไปเป็น  long  ( ทำในวงเล็บก่อน )  จากนั้น แปลงค่าจาก  long  ให้เป็น  double

More Related Content

Viewers also liked

Company overview
Company overviewCompany overview
Company overviewPwhelan
 
2012 goodby belly fat
2012 goodby belly fat2012 goodby belly fat
2012 goodby belly fatAndy_300
 
Federal Reserve housing white paper
Federal Reserve housing white paperFederal Reserve housing white paper
Federal Reserve housing white paperBruce Judson
 
โจทย์ Java
โจทย์ Javaโจทย์ Java
โจทย์ Javaxuou888
 
7 pointer day10
7  pointer day107  pointer day10
7 pointer day10xuou888
 
Discipulado para jovens e adultos
Discipulado para jovens e adultosDiscipulado para jovens e adultos
Discipulado para jovens e adultosVilmar Nascimento
 
Discipulado para crianças 2
Discipulado para crianças   2Discipulado para crianças   2
Discipulado para crianças 2Vilmar Nascimento
 

Viewers also liked (8)

Company overview
Company overviewCompany overview
Company overview
 
2012 goodby belly fat
2012 goodby belly fat2012 goodby belly fat
2012 goodby belly fat
 
Federal Reserve housing white paper
Federal Reserve housing white paperFederal Reserve housing white paper
Federal Reserve housing white paper
 
โจทย์ Java
โจทย์ Javaโจทย์ Java
โจทย์ Java
 
7 pointer day10
7  pointer day107  pointer day10
7 pointer day10
 
Discipulado para jovens e adultos
Discipulado para jovens e adultosDiscipulado para jovens e adultos
Discipulado para jovens e adultos
 
Discipulado para crianças
Discipulado para criançasDiscipulado para crianças
Discipulado para crianças
 
Discipulado para crianças 2
Discipulado para crianças   2Discipulado para crianças   2
Discipulado para crianças 2
 

Similar to 1 test

หลัการเบื้องต้นการเขียนโปรแกรมVB6.0
หลัการเบื้องต้นการเขียนโปรแกรมVB6.0หลัการเบื้องต้นการเขียนโปรแกรมVB6.0
หลัการเบื้องต้นการเขียนโปรแกรมVB6.0sup11
 
3.ประเภทของข้อมูลและตัวดำเนินการ
3.ประเภทของข้อมูลและตัวดำเนินการ3.ประเภทของข้อมูลและตัวดำเนินการ
3.ประเภทของข้อมูลและตัวดำเนินการmansuang1978
 
การเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา Cการเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา CWarawut
 
Computer programming
Computer programmingComputer programming
Computer programmingJariyaa
 

Similar to 1 test (20)

4 control statement
4  control statement4  control statement
4 control statement
 
Tec4
Tec4Tec4
Tec4
 
3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ
 
Array 2
Array 2Array 2
Array 2
 
หลัการเบื้องต้นการเขียนโปรแกรมVB6.0
หลัการเบื้องต้นการเขียนโปรแกรมVB6.0หลัการเบื้องต้นการเขียนโปรแกรมVB6.0
หลัการเบื้องต้นการเขียนโปรแกรมVB6.0
 
C lang
C langC lang
C lang
 
3.ประเภทของข้อมูลและตัวดำเนินการ
3.ประเภทของข้อมูลและตัวดำเนินการ3.ประเภทของข้อมูลและตัวดำเนินการ
3.ประเภทของข้อมูลและตัวดำเนินการ
 
3.6 การเขียนโปรแกรมคำนวณ
3.6 การเขียนโปรแกรมคำนวณ3.6 การเขียนโปรแกรมคำนวณ
3.6 การเขียนโปรแกรมคำนวณ
 
3.8 การเขียนโปรแกรมคำนวณ
3.8 การเขียนโปรแกรมคำนวณ3.8 การเขียนโปรแกรมคำนวณ
3.8 การเขียนโปรแกรมคำนวณ
 
Midterm
MidtermMidterm
Midterm
 
3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ
 
3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ
 
3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ3.8 การทำงานตามลำดับ
3.8 การทำงานตามลำดับ
 
3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ3.8 การทำงานแบบลำดับ
3.8 การทำงานแบบลำดับ
 
C language
C languageC language
C language
 
Computer Programming 3
Computer Programming 3 Computer Programming 3
Computer Programming 3
 
Computer Programming 2.2
Computer Programming 2.2Computer Programming 2.2
Computer Programming 2.2
 
การเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา Cการเขียนฟังก์ชั่นในภาษา C
การเขียนฟังก์ชั่นในภาษา C
 
Computer programming
Computer programmingComputer programming
Computer programming
 
ตัวอย่างโปรแกรมลงBlog
ตัวอย่างโปรแกรมลงBlogตัวอย่างโปรแกรมลงBlog
ตัวอย่างโปรแกรมลงBlog
 

1 test

  • 2. ลำดับการทำงานของ Operator ลำดับความสำคัญจากสูงไปต่ำ โอเปอเรเตอร์ ( ) ++, -- -( เครื่องหมายลบหน้าตัวเลข ) * , / , % + , -
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Integer เลขจำนวนเต็ม Type Signed Byte Lower upper shot int signed 2 (16 bit) -32,768 32,768 unsigned 2 (16 bit) 0 65535 Int (16bits) signed 2 (16 bit) -32,768 32,768 unsigned 2 (16 bit) 0 65535 Int (32 bits) signed 4 (32 bit) -2,147,483,648 2,147,483,647 unsigned 4 (32 bit) 0 4,294,967,295 long int signed 4 (32 bit) -2,147,483,648 2,147,483,647 unsigned 4 (32 bit) 0 4,294,967,295
  • 14. Float เลขทศนิยม -38 -308 -4932 38 308 4932 Character ชนิดข้อมูลแบบอักษร ชนิดข้อมูลแบบอักษร คือข้อมูลประเภท char ซึ่งจะเก็บได้ 1 ตัวอักษร เครื่องจะทำ การเก็บอยู่ในรูปของรหัส Ascii เช่น A = 65 หรือ 0110 0001 Type Byte Lower Upper float 4 3.4 x 10 3.4 x 10 double 8 1.7x10 1.7x10 long double 10 3.4x10 3.4x10
  • 17.
  • 18.