Recommended
DOCX
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
PDF
PPTX
KEY
PDF
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
PDF
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
KEY
PDF
PDF
ECMAscript 2015 aka ES6 : à la découverte du nouveau javascript
DOCX
Simulacion - Algoritmo congruencial cuadratico
PDF
PDF
PDF
Most Common JavaScript Mistakes
PDF
Programación funcional en Haskell
DOCX
Cómo crear una calculadora js jv-ng
PDF
PPTX
Understanding Python decorators
PDF
Java & le pattern matching
PPTX
Алексей Кутумов, C++ без исключений, часть 3
DOC
DOCX
PPTX
Clang-tidy: путешествие внутрь AST C++
PDF
Sujet bac info 2012 g1, g2 et g3 avec correction
PPTX
PDF
PPTX
PPT
TXT
DOCX
DOCX
More Related Content
DOCX
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
PDF
PPTX
KEY
PDF
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
PDF
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30
KEY
PDF
What's hot
PDF
ECMAscript 2015 aka ES6 : à la découverte du nouveau javascript
DOCX
Simulacion - Algoritmo congruencial cuadratico
PDF
PDF
PDF
Most Common JavaScript Mistakes
PDF
Programación funcional en Haskell
DOCX
Cómo crear una calculadora js jv-ng
PDF
PPTX
Understanding Python decorators
PDF
Java & le pattern matching
PPTX
Алексей Кутумов, C++ без исключений, часть 3
DOC
DOCX
PPTX
Clang-tidy: путешествие внутрь AST C++
PDF
Sujet bac info 2012 g1, g2 et g3 avec correction
PPTX
PDF
PPTX
PPT
TXT
Viewers also liked
DOCX
DOCX
DOCX
PDF
PPTX
Arte romano introducción 2010 2011
PPTX
9 geo población ii 2010 2011
PPTX
8 geo población i 2010 2011
DOC
Diefdinsis koinonikis pronoias
PPT
5 geo atmósfera y climas 2010 2011
PPT
1 geo astronomía 2012 2013 1º eso
DOCX
PPTX
5 arte gótico introducción 2010 2011
PPTX
Arte renacimiento introducción 2010 2011
โปรแกรมย่อยและฟังก์ชันมาตรฐาน 1. 15
18
19
31
37
38
39
6/2
1 2555
3. 4. 5. standard functions)
C h
eader file C h
header file
#include<header file.h>
C compiler
” library functions)
6. type int , float , char ,
double , void
void
int
function_name
type parameter parameter , N
parameter void
{
location variable declaration
statement_ ; statement_ ; ... statement_N
return(value);
void)
return
}
7. 1. User-defined
Function)
2. Standard Function)
include directives header
file
2
1.
2.
#include <stdio.h>
Main ()
{
Function-name2 ();
…………………...
Function-name1 ();
}
#include <stdio.h>
Main ()
{
Function-name1 ();
8. 9. 10. Addition (a,b) ;
}
Void addition (int m , int n)
{
…............
}
Type_variable function_name parameter_name,… ;
Type_variable
function_name
parameter_name
11. 12. (Local Variable)
(Global Variable)
(
)
/* 7th Sample Program: Local vs Global Variable */
#include<stdio.h>
int ans = 0;
int inc_one(int); /* function prototype */
void main()
{
int a = 3;
ans = inc_one(a);
printf(“Answer is %dn”, ans);
}
/* function definition: return x+1 */
int inc_one(int x)
{
int ans;
ans = x + 1;
13. return ans;
}
ans
(main)
ans
a
inc_one x ans
ans ans
inc_one ans
inc_one
ans
inc_one ans
ans
14. #vinclude
2.1
sinz x
: sin x x
Sin x ;
cos x
: cossine x x
cos x ;
tan x
: tangent x x
tan x ;
15. sqrt x
: 2 square root x x
sqrt x ;
pow x,y
: x y x 0
pow x ;
ceil x
:
ceil x ;
floor x
:
floor x ;
log x
16. : log n x x 0
log x ;
sinz x
: sin x x
Sin x ;
log10 x
: log 10 x
log10 x ;
exp x
: e e
2.718282 x e
exp x ;
fabs x
17. : x
fabs x ;
2.2
strcpy
: string2
m string1
Strcpy string1,
string2
strcat
:
string2 string1
strcat string1, string2
strcmp
:
Strcmp string1,
string2
strlen
18. :
Strlen string
strcmpi
:
- string1 string2 0
- string1 < string2 <0
- string1 > string2 >0
Strcmp string1, strin
g2
2.3
tolower
:
Tolower character
toupper
:
Toupper character
19. 20. 22. 24. 25. 26. strcmp
rung
do
{
……………………….
} while (ans !=’n’) ;
27. 28. 29. 6
1.
. type_variable function_name (parameter_name,…);
. type_variable function_none (parameter_name,…);
. variable function_name (parameter_name,…);
. type_variable function_name (parameter_,…);
2.type_variable
.
.
.
.
30. 3.function_name
.
.
.
.
4. 1
. void
. void
.
.
5.
. void function_name (type_parameter parameter_name[…]);
. void function_name (type_parameter parameter_name);
. void function_name (type_parameter parameter […]);
31. 32. 33. 35. . 7 C
http://e-
learning.snru.ac.th/els/program lesson page _ html
21 2555.
http://uhost.rmutp.ac.t
h/kriengkri.l/w3.pdf 18 2555