SlideShare a Scribd company logo
3




C

                                                          C

                                                          Standard

             Output File      Standard Input File   3-1




                    3-1

             Standard Input
File              Buffered



Standard Output
File




                              C       printf



Printf (“[             ”,[
3–2                   Output




                           Input           Output       3 -1

        3–1


               char               -                 c   %c
            short int            h                  d   %hd
                int               -                 d   %d
             long int          I or L               d   %Ld
               float              -                 f   %f
              double              -                 f   %f
           long doule             L                 f   %Lf




%[

                        3- 2

        3 -2

               %d                  %4d
   12          12                    12
123            123                 123
1234           1234                1234
12345          12345               12345
                               float

%[
printf(“%7.2f”,23.35000);
                                        5                   4

          1                             2

                      23.35



1. printf(“%d%c%f”,23, „z‟,4.1);



                      23z4.100000




2. printf(“%d %c %f”, 23. „z‟, 4.1);



           23 z 4.100000
                      1

3.        int num1 = 23;
char zee = „z‟;
float num2 = 4.1;
printf(“%d %c %f”, num1, zee, num2);



           23 z 4.100000
4.        printf(“%dt%ct%5.1f”, 23, „z‟, 14.2);
printf(“%dt%ct%5.1f”, 107, „A‟, 53.6);
printf(“%dt%ct%5.1f”, 1754, „F‟, 122.0);
printf(“%dt%ct%5.1f”, 3, „P‟, 0.1);



                      23                    z       14.2
                      107                   A       53.6
                      1754                  F       122.0
                      3                      P      0.1
5. printf(“The number is %6d”, 23);
The number is         23
        C




                                  Back-slash character       3-3

            3-3     Back-slash character


            „0‟         Null Character
            „a‟              Alert
            „b‟           Backspace
            „t‟           Horizontal
            „n‟             Newline
            „v‟           Vertical tab
             „f‟          Form feed
            „r‟         Carriage return
              „‟         Single quote
            „”‟          Double quote
            „‟            Backslash



1. printf(“%d %d %dn”, 44, 55);
44 55 0
                                 3                   2

2. printf(“%d %dn”, 44, 55, 66);
44 55
                                      2                  3    3



3. long int x = 444446766;
printf(“%dn”, x);
-18386


                                 Ld



                                       C    scanf
Scanf(“[               ”,[




                        3-3



                                            Enter



                                                    Error



1. 214 156 14z
scanf(“%d%d%d%c”, &a, &b, &c, %d);
                      14      z         c



           scanf(“%d%d%d %c”, &a, &b, &c, %d);
2. 2314 15 2.14
scanf(“%d %d %f”, &a, &b, &c);



3. 14/26 25/66
scanf(“%2d/%2d %2d/%2d”, &num1, &num2, &num3, &num4);



4. 11-25-56
scanf(“%d-%d-%d”,&a, &b, &c);



1. int a = 0;
scanf(“%d”,a);
printf(“%d/n”,a);
234                  (Input)
                                 0                      (Output)
                                         &       a

                                         error

2. float a = 2.1;
scanf(“%5.2f”,&a);
printf(“%5.2f”,a);




3. int a;
Int b;
scanf(“%d%d%d”,&a, &b);
Printf(“%d %d/n”, a, b);
5 10                 (Input)
                      5 10                   (Output)
                                     3                           2   scanf

            2                                             3



                                                     conio.h

getch                                                    1

                             Enter




            ch = getch();
getche                               getch



ch = getch();
getchar                                                      1

                                     Enter
ch = getchar(0;



        3-1              “Nothing”

                   3-1               “Nothing”




                  3-2
3-2

More Related Content

What's hot

C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
Rumman Ansari
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
Syed Umair
 
C programs
C programsC programs
C programs
Minu S
 
week-18x
week-18xweek-18x
C lab programs
C lab programsC lab programs
C lab programs
Dr. Prashant Vats
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
Rumman Ansari
 
Avl tree
Avl treeAvl tree
week-1x
week-1xweek-1x
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
Abdullah Al Naser
 
week-11x
week-11xweek-11x
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
Prabhu Govind
 
Tu1
Tu1Tu1
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
knang
 
C Programming lab
C Programming labC Programming lab
C Programming lab
Vikram Nandini
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 
Circular queue
Circular queueCircular queue
Circular queue
ShobhaHiremath8
 
ภาษา C
ภาษา Cภาษา C
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 

What's hot (18)

C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
C programs
C programsC programs
C programs
 
week-18x
week-18xweek-18x
week-18x
 
C lab programs
C lab programsC lab programs
C lab programs
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
Avl tree
Avl treeAvl tree
Avl tree
 
week-1x
week-1xweek-1x
week-1x
 
The solution manual of c by robin
The solution manual of c by robinThe solution manual of c by robin
The solution manual of c by robin
 
week-11x
week-11xweek-11x
week-11x
 
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
 
Tu1
Tu1Tu1
Tu1
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
 
C Programming lab
C Programming labC Programming lab
C Programming lab
 
ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
Circular queue
Circular queueCircular queue
Circular queue
 
ภาษา C
ภาษา Cภาษา C
ภาษา C
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 

Viewers also liked

Mane wk9 term 1 13pdf
Mane wk9 term 1 13pdfMane wk9 term 1 13pdf
Mane wk9 term 1 13pdf
takp
 
Turei week 8 term 3
Turei week 8 term 3 Turei week 8 term 3
Turei week 8 term 3
takp
 
Wenerei wk 3 term 3 13pdf
Wenerei wk 3 term 3 13pdfWenerei wk 3 term 3 13pdf
Wenerei wk 3 term 3 13pdf
takp
 
Turei wk 2 term 3 13 pdf2
Turei wk 2 term 3 13 pdf2Turei wk 2 term 3 13 pdf2
Turei wk 2 term 3 13 pdf2
takp
 
ANZ Law Seminar _Law resources overview V2
ANZ Law Seminar _Law resources overview V2ANZ Law Seminar _Law resources overview V2
ANZ Law Seminar _Law resources overview V2
tinaarg
 
Ppt
PptPpt
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
wangqiongapp
 
Taite wk10 term 1 13 pdf one
Taite wk10 term 1 13 pdf oneTaite wk10 term 1 13 pdf one
Taite wk10 term 1 13 pdf one
takp
 
One-min Intro to Spectator.do
One-min Intro to Spectator.do One-min Intro to Spectator.do
One-min Intro to Spectator.do
Bao-Wen Chen
 
Mane wk8 term 1 13pdf
Mane wk8 term 1 13pdfMane wk8 term 1 13pdf
Mane wk8 term 1 13pdf
takp
 
Midia Kit Brasil Game Day (English)
Midia Kit Brasil Game Day (English)Midia Kit Brasil Game Day (English)
Midia Kit Brasil Game Day (English)
LeadMedia Publishing
 
Arvore Decisões - Discador windows - Bridge
Arvore Decisões - Discador windows - BridgeArvore Decisões - Discador windows - Bridge
Arvore Decisões - Discador windows - Bridge
silvamtt2003
 
Turei wk 1 term 3 13pdf
Turei wk 1 term 3 13pdfTurei wk 1 term 3 13pdf
Turei wk 1 term 3 13pdf
takp
 
Section C (Know your spelling)
Section C (Know your spelling)Section C (Know your spelling)
Section C (Know your spelling)
Rafidah Roslan
 
Turei wk2 term 2
Turei wk2 term 2Turei wk2 term 2
Turei wk2 term 2
takp
 
MODAL VERBS
MODAL VERBSMODAL VERBS
MODAL VERBS
Adrian Phelipe
 
Outer banks
Outer banksOuter banks
Outer banks
efikmovy
 
Lilianagbiu
LilianagbiuLilianagbiu
LU分解について
LU分解についてLU分解について
LU分解について
Jayson Toma
 

Viewers also liked (20)

T301
T301T301
T301
 
Mane wk9 term 1 13pdf
Mane wk9 term 1 13pdfMane wk9 term 1 13pdf
Mane wk9 term 1 13pdf
 
Turei week 8 term 3
Turei week 8 term 3 Turei week 8 term 3
Turei week 8 term 3
 
Wenerei wk 3 term 3 13pdf
Wenerei wk 3 term 3 13pdfWenerei wk 3 term 3 13pdf
Wenerei wk 3 term 3 13pdf
 
Turei wk 2 term 3 13 pdf2
Turei wk 2 term 3 13 pdf2Turei wk 2 term 3 13 pdf2
Turei wk 2 term 3 13 pdf2
 
ANZ Law Seminar _Law resources overview V2
ANZ Law Seminar _Law resources overview V2ANZ Law Seminar _Law resources overview V2
ANZ Law Seminar _Law resources overview V2
 
Ppt
PptPpt
Ppt
 
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
An analysis of the role played by the ‘China Import and Export Fair’ in Canto...
 
Taite wk10 term 1 13 pdf one
Taite wk10 term 1 13 pdf oneTaite wk10 term 1 13 pdf one
Taite wk10 term 1 13 pdf one
 
One-min Intro to Spectator.do
One-min Intro to Spectator.do One-min Intro to Spectator.do
One-min Intro to Spectator.do
 
Mane wk8 term 1 13pdf
Mane wk8 term 1 13pdfMane wk8 term 1 13pdf
Mane wk8 term 1 13pdf
 
Midia Kit Brasil Game Day (English)
Midia Kit Brasil Game Day (English)Midia Kit Brasil Game Day (English)
Midia Kit Brasil Game Day (English)
 
Arvore Decisões - Discador windows - Bridge
Arvore Decisões - Discador windows - BridgeArvore Decisões - Discador windows - Bridge
Arvore Decisões - Discador windows - Bridge
 
Turei wk 1 term 3 13pdf
Turei wk 1 term 3 13pdfTurei wk 1 term 3 13pdf
Turei wk 1 term 3 13pdf
 
Section C (Know your spelling)
Section C (Know your spelling)Section C (Know your spelling)
Section C (Know your spelling)
 
Turei wk2 term 2
Turei wk2 term 2Turei wk2 term 2
Turei wk2 term 2
 
MODAL VERBS
MODAL VERBSMODAL VERBS
MODAL VERBS
 
Outer banks
Outer banksOuter banks
Outer banks
 
Lilianagbiu
LilianagbiuLilianagbiu
Lilianagbiu
 
LU分解について
LU分解についてLU分解について
LU分解について
 

Similar to บทที่ 3

ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
kramsri
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf
sutharbharat59
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
Ankit Kumar
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
Ashishchinu
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
Abdullah Al Shiam
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
University of Potsdam
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
ab11cs001
 
คำสั่ง Switch
คำสั่ง Switchคำสั่ง Switch
คำสั่ง Switch
kramsri
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
Koshy Geoji
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
Abhishek Sinha
 
comp2
comp2comp2
comp2
franzneri
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
manoj11manu
 
c programs.pptx
c programs.pptxc programs.pptx
c programs.pptx
LavanyaDiet1
 
C-programs
C-programsC-programs
C-programs
SSGMCE SHEGAON
 
C basics
C basicsC basics
C basics
MSc CST
 
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชันตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
Warawut
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
Mazedurr rahman
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
Krunee Thitthamon
 

Similar to บทที่ 3 (20)

ภาษาซี
ภาษาซีภาษาซี
ภาษาซี
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
คำสั่ง Switch
คำสั่ง Switchคำสั่ง Switch
คำสั่ง Switch
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
comp2
comp2comp2
comp2
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
c programs.pptx
c programs.pptxc programs.pptx
c programs.pptx
 
C-programs
C-programsC-programs
C-programs
 
C basics
C basicsC basics
C basics
 
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชันตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
ตัวอย่างการเขียนโปรแกรม โดยใช้ฟังก์ชัน
 
C programming BY Mazedur
C programming BY MazedurC programming BY Mazedur
C programming BY Mazedur
 
ภาษาซีพื้นฐาน
ภาษาซีพื้นฐานภาษาซีพื้นฐาน
ภาษาซีพื้นฐาน
 

Recently uploaded

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 

Recently uploaded (20)

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 

บทที่ 3

  • 1. 3 C C Standard Output File Standard Input File 3-1 3-1 Standard Input File Buffered Standard Output File C printf Printf (“[ ”,[
  • 2. 3–2 Output Input Output 3 -1 3–1 char - c %c short int h d %hd int - d %d long int I or L d %Ld float - f %f double - f %f long doule L f %Lf %[ 3- 2 3 -2 %d %4d 12 12 12 123 123 123 1234 1234 1234 12345 12345 12345 float %[
  • 3. printf(“%7.2f”,23.35000); 5 4 1 2 23.35 1. printf(“%d%c%f”,23, „z‟,4.1); 23z4.100000 2. printf(“%d %c %f”, 23. „z‟, 4.1); 23 z 4.100000 1 3. int num1 = 23; char zee = „z‟; float num2 = 4.1; printf(“%d %c %f”, num1, zee, num2); 23 z 4.100000 4. printf(“%dt%ct%5.1f”, 23, „z‟, 14.2); printf(“%dt%ct%5.1f”, 107, „A‟, 53.6); printf(“%dt%ct%5.1f”, 1754, „F‟, 122.0); printf(“%dt%ct%5.1f”, 3, „P‟, 0.1); 23 z 14.2 107 A 53.6 1754 F 122.0 3 P 0.1 5. printf(“The number is %6d”, 23);
  • 4. The number is 23 C Back-slash character 3-3 3-3 Back-slash character „0‟ Null Character „a‟ Alert „b‟ Backspace „t‟ Horizontal „n‟ Newline „v‟ Vertical tab „f‟ Form feed „r‟ Carriage return „‟ Single quote „”‟ Double quote „‟ Backslash 1. printf(“%d %d %dn”, 44, 55); 44 55 0 3 2 2. printf(“%d %dn”, 44, 55, 66); 44 55 2 3 3 3. long int x = 444446766; printf(“%dn”, x); -18386 Ld C scanf
  • 5. Scanf(“[ ”,[ 3-3 Enter Error 1. 214 156 14z scanf(“%d%d%d%c”, &a, &b, &c, %d); 14 z c scanf(“%d%d%d %c”, &a, &b, &c, %d); 2. 2314 15 2.14 scanf(“%d %d %f”, &a, &b, &c); 3. 14/26 25/66 scanf(“%2d/%2d %2d/%2d”, &num1, &num2, &num3, &num4); 4. 11-25-56 scanf(“%d-%d-%d”,&a, &b, &c); 1. int a = 0; scanf(“%d”,a); printf(“%d/n”,a);
  • 6. 234 (Input) 0 (Output) & a error 2. float a = 2.1; scanf(“%5.2f”,&a); printf(“%5.2f”,a); 3. int a; Int b; scanf(“%d%d%d”,&a, &b); Printf(“%d %d/n”, a, b); 5 10 (Input) 5 10 (Output) 3 2 scanf 2 3 conio.h getch 1 Enter ch = getch(); getche getch ch = getch(); getchar 1 Enter
  • 7. ch = getchar(0; 3-1 “Nothing” 3-1 “Nothing” 3-2
  • 8. 3-2