SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Object-Oriented Programming Language
                                Chapter 2 : Programming in Objective-C


                                               Atit Patumvan
                               Faculty of Management and Information Sciences
                                             Naresuna University




วันอังคารที่ 7 กุมภาพันธ์ 12
2



                                                               Program 2.1 (ex02-01.m)



        // First program example

        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        ! NSLog (@"Programming is fun");
        !
        ! [pool drain];
        ! return 0;
        }




 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
3



                                                   Compile and Running Program


                    •          OSX
                               gcc -framework Foundation hello.m -o hello

                    •          Windows: GNUStep: gcc
                               gcc `gnustep-config --objc-flags` -L /GNUstep/System/
                               Library/Libraries hello.m -o hello -lgnustep-base -lobjc

                    •          Linux
                               gcc `gnustep-config --objc-flags` hello.m -o hello -I /
                               usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lgnustep-
                               base



 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
4



                                                      Common Filename Extension



                     Extension                                                        Meaning
                                    .c                              C language source file
                          .cc, .cpp                                 C++ language source file
                                    .h                              Header file
                                   .m                               Objective-C source file
                                .mm                                 Objective-C++ source file
                                   .pl                              Perl source file
                                   .o                               Object (compiled) file

 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University             Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
5



                                             Explanation of Your First Program



        // First program example

        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        ! NSLog (@"Programming is fun");
        !
        ! [pool drain];
        ! return 0;
        }




 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University   Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
6



                                                               Program 2.2 (ex02-02.m)


        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        !
        ! NSLog (@"Programming is fun");
        ! NSLog (@"Programming in Objective-C is event more fun!");
        !
        ! [pool drain];
        ! return 0;
        }




         Programming is fun
         Programming in Objective-C is event more fun!

 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
7



                                                               Program 2.3 (ex02-03.m)



        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        !
        ! NSLog (@"Testing...n..1n...2n....3");
        !
        ! [pool drain];
        ! return 0;
        }




        Testing...
        ..1
        ...2
        ....3
 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
8



                                                               Program 2.4 (ex02-04.m)

        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        !
        ! int sum;
        !
        ! sum = 50 + 25;
        ! NSLog (@"The sum of 50 and 25 is %i", sum);
        !
        ! [pool drain];
        !
        ! return 0;
        }




        The sum of 50 and 25 is 75
 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12
9



                                                               Program 2.5 (ex02-05.m)


        #import <Foundation/Foundation.h>

        int main (int argc, const char * argv[])
        {
        ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        !
        ! int value1, value2, sum;
        !
        ! value1 = 50;
        ! value2 = 25;
        ! sum = value1 + value2;
        ! NSLog (@"The sum of %i and %i is %i", value1, value2, sum);
        !
        ! [pool drain];
        !
        ! return 0;
        }

        The sum of 50 and 25 is 75
 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University      Object-Oriented Programming Language

วันอังคารที่ 7 กุมภาพันธ์ 12

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (7)

Python Application: Visual Approach of Hopfield Discrete Method for Hiragana ...
Python Application: Visual Approach of Hopfield Discrete Method for Hiragana ...Python Application: Visual Approach of Hopfield Discrete Method for Hiragana ...
Python Application: Visual Approach of Hopfield Discrete Method for Hiragana ...
 
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
Generating Assertion Code from OCL: A Transformational Approach Based on Simi...
 
Unit 8
Unit 8Unit 8
Unit 8
 
SDE - Dynamic Analysis
SDE - Dynamic AnalysisSDE - Dynamic Analysis
SDE - Dynamic Analysis
 
Life & Work of Robin Milner | Turing100@Persistent
Life & Work of Robin Milner | Turing100@PersistentLife & Work of Robin Milner | Turing100@Persistent
Life & Work of Robin Milner | Turing100@Persistent
 
Data structure week 1
Data structure week 1Data structure week 1
Data structure week 1
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
 

Ähnlich wie OOP: Chapter 2: Programming in Objective-C

OOP Chapter 5 : Program Looping
OOP Chapter 5 : Program Looping OOP Chapter 5 : Program Looping
OOP Chapter 5 : Program Looping
Atit Patumvan
 
Requirment
RequirmentRequirment
Requirment
stat
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
Yen_CY
 

Ähnlich wie OOP: Chapter 2: Programming in Objective-C (20)

OOP Chapter 5 : Program Looping
OOP Chapter 5 : Program Looping OOP Chapter 5 : Program Looping
OOP Chapter 5 : Program Looping
 
MAVRL Workshop 2014 - Python Materials Genomics (pymatgen)
MAVRL Workshop 2014 - Python Materials Genomics (pymatgen)MAVRL Workshop 2014 - Python Materials Genomics (pymatgen)
MAVRL Workshop 2014 - Python Materials Genomics (pymatgen)
 
Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)Massively Parallel Processing with Procedural Python (PyData London 2014)
Massively Parallel Processing with Procedural Python (PyData London 2014)
 
Euro python2011 High Performance Python
Euro python2011 High Performance PythonEuro python2011 High Performance Python
Euro python2011 High Performance Python
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOS
 
cv
cvcv
cv
 
Massively Parallel Process with Prodedural Python by Ian Huston
Massively Parallel Process with Prodedural Python by Ian HustonMassively Parallel Process with Prodedural Python by Ian Huston
Massively Parallel Process with Prodedural Python by Ian Huston
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Compiling Qt Apps
Compiling Qt AppsCompiling Qt Apps
Compiling Qt Apps
 
PHYTON-REPORT.pdf
PHYTON-REPORT.pdfPHYTON-REPORT.pdf
PHYTON-REPORT.pdf
 
EuroHPC AI in DAPHNE
EuroHPC AI in DAPHNEEuroHPC AI in DAPHNE
EuroHPC AI in DAPHNE
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Requirment
RequirmentRequirment
Requirment
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Pythonpresent
PythonpresentPythonpresent
Pythonpresent
 
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
 
Resume
ResumeResume
Resume
 
[計一] Basic r programming final0918
[計一] Basic r programming   final0918[計一] Basic r programming   final0918
[計一] Basic r programming final0918
 

Mehr von Atit Patumvan

แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ตแบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
Atit Patumvan
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics tools
Atit Patumvan
 
Computer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : MethodsComputer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : Methods
Atit Patumvan
 
Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops
Atit Patumvan
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
Atit Patumvan
 

Mehr von Atit Patumvan (20)

Iot for smart agriculture
Iot for smart agricultureIot for smart agriculture
Iot for smart agriculture
 
An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)An Overview of eZee Burrp! (Philus Limited)
An Overview of eZee Burrp! (Philus Limited)
 
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ตแบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
แบบฝึกหัดวิชา Theory of Computation ชุดที่ 1 เซ็ต
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics tools
 
Chapter 1 mathmatics tools
Chapter 1 mathmatics toolsChapter 1 mathmatics tools
Chapter 1 mathmatics tools
 
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
รายงานการประเมินคุณภาพภายใน ปีงบประมาณ 2556
 
Chapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computationChapter 0 introduction to theory of computation
Chapter 0 introduction to theory of computation
 
Media literacy
Media literacyMedia literacy
Media literacy
 
Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)Chapter 01 mathmatics tools (slide)
Chapter 01 mathmatics tools (slide)
 
การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8การบริหารเชิงคุณภาพ ชุดที่ 8
การบริหารเชิงคุณภาพ ชุดที่ 8
 
การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7การบริหารเชิงคุณภาพ ชุดที่ 7
การบริหารเชิงคุณภาพ ชุดที่ 7
 
การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6การบริหารเชิงคุณภาพ ชุดที่ 6
การบริหารเชิงคุณภาพ ชุดที่ 6
 
Computer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : MethodsComputer Programming Chapter 5 : Methods
Computer Programming Chapter 5 : Methods
 
Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops Computer Programming Chapter 4 : Loops
Computer Programming Chapter 4 : Loops
 
Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)Introduction to Java EE (J2EE)
Introduction to Java EE (J2EE)
 
การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5การบริหารเชิงคุณภาพ ชุดที่ 5
การบริหารเชิงคุณภาพ ชุดที่ 5
 
การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4การบริหารเชิงคุณภาพ ชุดที่ 4
การบริหารเชิงคุณภาพ ชุดที่ 4
 
การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3การบริหารเชิงคุณภาพ ชุดที่ 3
การบริหารเชิงคุณภาพ ชุดที่ 3
 
การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2การบริหารเชิงคุณภาพ ชุดที่ 2
การบริหารเชิงคุณภาพ ชุดที่ 2
 
Computer Programming: Chapter 1
Computer Programming: Chapter 1Computer Programming: Chapter 1
Computer Programming: Chapter 1
 

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

OOP: Chapter 2: Programming in Objective-C

  • 1. Object-Oriented Programming Language Chapter 2 : Programming in Objective-C Atit Patumvan Faculty of Management and Information Sciences Naresuna University วันอังคารที่ 7 กุมภาพันธ์ 12
  • 2. 2 Program 2.1 (ex02-01.m) // First program example #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! NSLog (@"Programming is fun"); ! ! [pool drain]; ! return 0; } Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 3. 3 Compile and Running Program • OSX gcc -framework Foundation hello.m -o hello • Windows: GNUStep: gcc gcc `gnustep-config --objc-flags` -L /GNUstep/System/ Library/Libraries hello.m -o hello -lgnustep-base -lobjc • Linux gcc `gnustep-config --objc-flags` hello.m -o hello -I / usr/include/GNUstep/ -L /usr/lib/GNUstep/ -lgnustep- base Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 4. 4 Common Filename Extension Extension Meaning .c C language source file .cc, .cpp C++ language source file .h Header file .m Objective-C source file .mm Objective-C++ source file .pl Perl source file .o Object (compiled) file Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 5. 5 Explanation of Your First Program // First program example #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! NSLog (@"Programming is fun"); ! ! [pool drain]; ! return 0; } Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 6. 6 Program 2.2 (ex02-02.m) #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! ! NSLog (@"Programming is fun"); ! NSLog (@"Programming in Objective-C is event more fun!"); ! ! [pool drain]; ! return 0; } Programming is fun Programming in Objective-C is event more fun! Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 7. 7 Program 2.3 (ex02-03.m) #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! ! NSLog (@"Testing...n..1n...2n....3"); ! ! [pool drain]; ! return 0; } Testing... ..1 ...2 ....3 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 8. 8 Program 2.4 (ex02-04.m) #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! ! int sum; ! ! sum = 50 + 25; ! NSLog (@"The sum of 50 and 25 is %i", sum); ! ! [pool drain]; ! ! return 0; } The sum of 50 and 25 is 75 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12
  • 9. 9 Program 2.5 (ex02-05.m) #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { ! NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ! ! int value1, value2, sum; ! ! value1 = 50; ! value2 = 25; ! sum = value1 + value2; ! NSLog (@"The sum of %i and %i is %i", value1, value2, sum); ! ! [pool drain]; ! ! return 0; } The sum of 50 and 25 is 75 Atit Patumvan, Faculty of Management and Information Sciences, Naresuan University Object-Oriented Programming Language วันอังคารที่ 7 กุมภาพันธ์ 12