SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
Standard library contains the
prepackaged functions which are used
while writing a ‘c’ program.
 This header file contains a number of pre-
defined/ library functions which performs
various mathematical calculations.
 To include math.h header file in program use
preprocessor directive-
#include< math.h >
 Modulus function calculates the remainder of
the division operation.
 In ‘c’ modulus function is applied on integer
numbers only by default.
 To apply modulus to floating point values we
use fmod , fmod l ,modf , modf l.
 Modf / modf l splits double/ long double
number into integer and fractional part
respectively.
 It stores the integer in ipart and returns the
fraction.
•Declaration :-
•Fmod , fmod l :-
double fmod (double x , double y);
long double fmod l(long double (x) , long double (y))
•Modf , modf l :-
double modf (double x , double *(ipart));
long double modf l(long double (x) , long double
*(ipart));
ARC FUNCTIONS
SIMPLE
FUNCTIONS
 acos
 asin
 atan
 atan2
 acosl
 asinl
 atanl
 atn2l
 cos
 sin
 tan
Declarations :-
• Real :-
1. doubleacos(double x);
2. doubleasin(double x);
3. doubleatan(double x);
4. doubleatan2(double x ,double y);
5. long double acosl(longdouble (x));
6. long double asinl(longdouble (x));
7. long double atanl(longdouble (x));
8. longdouble atan2l(longdouble(x), long double (y));
• Complex :-
1. Complex acos(complex x);
2. Complex asin(complex x);
3. complex atan(complex x);
Declarations :-
•Real :-
1. Double cos (double x);
2. Double sin (double x);
3. Double tan (double x);
4. Longdouble cos (long double x);
5. Longdouble sin (long double x);
6. Longdouble tan (long double x);
• Complex :-
1. Complex cos (complex x);
2. Complex sin (complex x);
3. complex tan (complex x);
 cosh
 sinh
 tanh
 coshl
 sinhl
 tanhl
Declarations :-
• Real :-
1. Double cosh (double x );
2. Double sinh (double x);
3. Double tanh (double x);
4. Long double coshl (long double x);
5. Long double sinhl (long double x);
6. Long double tanh (long double x);
• Complex :-
1. Complex cosh (complex x);
2. Complex sinh (complex x);
3. Complex tanh (complex x);
power function calculates the power of an input
number.
Syntax :-
power( base , exponent);
TO CALCULATE
POWER OF A
‘DESIRED’ NUMBER
TO CALCULATE
POWER OF ‘10’
 pow
 powl
 Pow10
 Pow10 l
Declaration :-
•Power :-
1. Double pow (double n , double p );
2. Long double pow (long double (n) , long double (p
3. Complex pow (complex n , complex p);
4. Complex pow (double n , complex p);
5. Complex pow (complex n , double p);
• Power10 :-
1. Double pow10 (int p);
2. Long double pow10 (int (p));
 Floor function rounds the value down.
 Floor returns integer found as double.
 Floorl returns integer found as long double.
 Declaration :-
double floor (double x);
long double floorl(long double (x));
 Ceiling function rounds up a number.
 Ceil returns an integer found as double.
 Ceill returns an integer found as long double.
Declaration :-
double ceil (double x);
long double ceil (long double (x));
 Exponential function is used to calculate the
powers of ‘e’.
 For Real numbers ‘e’ raised to power ‘x’ is
calculated.
 For complex numbers ‘e’ raised to power ‘z’ is
calculated (z is a complex number).
Declaration :-
• Real :-
1. double exp(double x);
2. long double exp (long double (x));
•Complex :-
1. complex exp(complex (z));
 square root function is used to calculate the
square root of a given number.
 Declaration :-
 Real :-
double sqrt (double x);
long double sqrt (long double (x));
 Complex :-
complex sqrt (complex x);
 absolute value function returns only the numerical
value without any sign.
 There are different types of abs function :-
o abs (a macro) finds absolute value of an integer .
o fabs , fabs l (macros) finds absolute values of
floating point values.
o Cabs , cabs l finds absolute values for complex
numbers.
o labs finds absolute values for long double values.
•Declaration :-
•abs :-
Real - int abs (int x);
Complex - complex abs (complex z);
•Fabs , fabd l :-
double fabs (double x);
long double fabs (long double @E(x));
•Cabs , cabd l :-
double cabs (struct_complex z);
long double cabd l (struct_complexl z);
•Labs :-
long int labs(long int x);
 This header file contains prepackaged
functions to perform various operations on
‘characters’.
 To include this header file in the program use
the preprocessor directive-
# include < ctype.h >
 toupper is a function which converts lowercase
characters to uppercase characters. If the input
character is already uppercase character then
those characters remain unchanged.
 _toupper is a macro which also converts
lowercase characters to uppercase characters.
But if the input characters have uppercase
characters in it then the result of _toupper is
‘undefined’.
•Declarations :-
1. int toupper (char ch);
2. Int _toupper (char ch);
 tolower is a function which converts uppercase
characters to lowercase characters. If the input
character is already lowercase character then
those characters remain unchanged.
 _tolower is a macro which also converts
uppercase characters to lowercase characters.
But if the input characters have lowercase
characters in it then the result of _tolower is
‘undefined’.
•Declarations :-
1. int tolower (char ch);
2. Int _tolower (char ch);
 Isspace checks it out whether an input
character is a space , tab , carriage return , new
line , vertical tab , or formfeed or not.
 It is a macro and returns a non-zero value on
success.
 Declaration :-
int isspace ( int c );
 The lower order byte of character is in the
range 0 to 127.
 It is a macro and returns a non-zero value on
success.
 Declaration :-
int isascii (int c);
 Isprint checks it out whether the input
character is a printing character or not.
 It is also a macro and returns a non-zero value
on success.
 Declaration :-
int isprint (int c);
 Isgraph checks it out whether input character is
a printing character or not like isprint except
that space character is excluded.
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int isgraph (int c);
 iscntrl checks it whether the input character is a
delete character or an ordinary control
character .
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int iscntrl ( int c);
 isxdigit checks out whether the input character
is a hexadecimal digit or not ( A to F , a to f , 0
to 9).
 It is also a macro &returns non-zero value on
success.
 Declaration :-
int isxdigit (int c);
 To include this header file in the program use
the preprocessor directive-
# include < stdlib.h >
 Abnormally terminates a process & writes a
termination message on stderr(“abnormal
program termination “) and then aborts the
program by a call to _exit with exit code 3.
 Declaration :-
void abort (void);
 atof converts a sting to floating point value .
 _atold converts a string to long double.
 Declaration :-
double atof (const char *s);
long double _atold (const char *(s));
 It is a macro that converts the string to integer.
 Declaration :-
int atoi (const char *s);
 Swab function copies nbytes from the “from”
string to the “to” string .nbytes should be even
.
 Adjacent even &odd bytes are swapped.
 This is useful for moving data from one
machine to another machine in different bytes
order.
 Declaration :-
void swab(char *from, char *to, int nbytes);
 System invokes the DOS command interpreter
file from inside an executing ‘c’ program to
execute a DOS command ,batch file , or other
program named by the string “command”.
 Declaration :-
int system (const char *command);
 time.h header file contains various functions
operating on time .
 Like clock, ctime, stime, time, difftime, acstime,
mktime, gmtime, localtime, etc.
 To include this header file in the program use
preprocessor directive-
# include < time.h >
 Clock returns the number of clock ticks since
program start.
 Clock can be used to determine the time
interval between two events.
 Declaration :-
clock_t clock (void);
 Asctime converts date and time to ascii.
 Ctime converts date and time to a string.
 Declaration :-
char *acstime (const struct tm *tblock);
char *ctime (const time_t *time);
 mktime converts time to calendar format .
 Declaration :-
time_t mktime (struct tm *t);
 time gets time of day.
 stime gets system date and time.
 Declaration :-
time_t time (time_t *timer );
int stime (time_t *tp);
 Difftime computes difference between 2 times.
 Declaration :-
double difftime(time_t time2,time_t time1);
 Gmtime converts date and time to Greenwich
Mean Time (GMT).
 Localtime converts date and time to a structure.
 Declaration :-
struct tm *gmtime(const time_t *timer);
struct tm *localtime(const time_t *timer);
MADE BY :-
VAISHNAVEE SHARMA

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

String functions in C
String functions in CString functions in C
String functions in C
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Learn C
Learn CLearn C
Learn C
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Function in c
Function in cFunction in c
Function in c
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshareC lecture 4 nested loops and jumping statements slideshare
C lecture 4 nested loops and jumping statements slideshare
 
Call by value
Call by valueCall by value
Call by value
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Break and continue
Break and continueBreak and continue
Break and continue
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
Union in c language
Union  in c languageUnion  in c language
Union in c language
 

Destacado

Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in Ccodewithc
 
ARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSstuti31
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
10 Creative Thinking Puzzles
10 Creative Thinking Puzzles10 Creative Thinking Puzzles
10 Creative Thinking PuzzlesOH TEIK BIN
 
Library Management System
Library Management SystemLibrary Management System
Library Management SystemAditya Shah
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics ConceptsSHAKOOR AB
 
Functions in c
Functions in cFunctions in c
Functions in cInnovative
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogrammingskashwin98
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programmingMahmoud Masih Tehrani
 
GO programming language
GO programming languageGO programming language
GO programming languagetung vu
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manualAnil Bishnoi
 
2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)Fe Angela Verzosa
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure harshil1902
 

Destacado (20)

Android
Android Android
Android
 
Library Management System Project in C
Library Management System Project in CLibrary Management System Project in C
Library Management System Project in C
 
functions in C
functions in Cfunctions in C
functions in C
 
ARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDSARCHITECTURAL STANDARDS
ARCHITECTURAL STANDARDS
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
10 Creative Thinking Puzzles
10 Creative Thinking Puzzles10 Creative Thinking Puzzles
10 Creative Thinking Puzzles
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
Computer Graphics Concepts
Computer Graphics ConceptsComputer Graphics Concepts
Computer Graphics Concepts
 
Otaku
OtakuOtaku
Otaku
 
What is Otaku
What is OtakuWhat is Otaku
What is Otaku
 
Functions in c
Functions in cFunctions in c
Functions in c
 
C-Header file
C-Header fileC-Header file
C-Header file
 
Intro to cprogramming
Intro to cprogrammingIntro to cprogramming
Intro to cprogramming
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
GO programming language
GO programming languageGO programming language
GO programming language
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)2010 PAARL Standards for Academic Libraries (Draft Proposal)
2010 PAARL Standards for Academic Libraries (Draft Proposal)
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure
 
Library Standards: CHED Policies and Guidelines on Book Holdings
Library Standards: CHED Policies and Guidelines on Book HoldingsLibrary Standards: CHED Policies and Guidelines on Book Holdings
Library Standards: CHED Policies and Guidelines on Book Holdings
 

Similar a C standard library functions

C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)Saifur Rahman
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4Saranya saran
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)SURBHI SAROHA
 
Introduction to c
Introduction to cIntroduction to c
Introduction to camol_chavan
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4MKalpanaDevi
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointJavaTpoint.Com
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1AmIt Prasad
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and typesimtiazalijoono
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework HelpC++ Homework Help
 

Similar a C standard library functions (20)

C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)C cheat sheet for varsity (extreme edition)
C cheat sheet for varsity (extreme edition)
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
venkatesh.pptx
venkatesh.pptxvenkatesh.pptx
venkatesh.pptx
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
C function
C functionC function
C function
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Matlab-3.pptx
Matlab-3.pptxMatlab-3.pptx
Matlab-3.pptx
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Alp 05
Alp 05Alp 05
Alp 05
 
Alp 05
Alp 05Alp 05
Alp 05
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
 

Último

Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 

Último (20)

Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 

C standard library functions

  • 1. Standard library contains the prepackaged functions which are used while writing a ‘c’ program.
  • 2.  This header file contains a number of pre- defined/ library functions which performs various mathematical calculations.  To include math.h header file in program use preprocessor directive- #include< math.h >
  • 3.  Modulus function calculates the remainder of the division operation.  In ‘c’ modulus function is applied on integer numbers only by default.  To apply modulus to floating point values we use fmod , fmod l ,modf , modf l.  Modf / modf l splits double/ long double number into integer and fractional part respectively.  It stores the integer in ipart and returns the fraction.
  • 4. •Declaration :- •Fmod , fmod l :- double fmod (double x , double y); long double fmod l(long double (x) , long double (y)) •Modf , modf l :- double modf (double x , double *(ipart)); long double modf l(long double (x) , long double *(ipart));
  • 5. ARC FUNCTIONS SIMPLE FUNCTIONS  acos  asin  atan  atan2  acosl  asinl  atanl  atn2l  cos  sin  tan
  • 6. Declarations :- • Real :- 1. doubleacos(double x); 2. doubleasin(double x); 3. doubleatan(double x); 4. doubleatan2(double x ,double y); 5. long double acosl(longdouble (x)); 6. long double asinl(longdouble (x)); 7. long double atanl(longdouble (x)); 8. longdouble atan2l(longdouble(x), long double (y)); • Complex :- 1. Complex acos(complex x); 2. Complex asin(complex x); 3. complex atan(complex x);
  • 7. Declarations :- •Real :- 1. Double cos (double x); 2. Double sin (double x); 3. Double tan (double x); 4. Longdouble cos (long double x); 5. Longdouble sin (long double x); 6. Longdouble tan (long double x); • Complex :- 1. Complex cos (complex x); 2. Complex sin (complex x); 3. complex tan (complex x);
  • 8.  cosh  sinh  tanh  coshl  sinhl  tanhl
  • 9. Declarations :- • Real :- 1. Double cosh (double x ); 2. Double sinh (double x); 3. Double tanh (double x); 4. Long double coshl (long double x); 5. Long double sinhl (long double x); 6. Long double tanh (long double x); • Complex :- 1. Complex cosh (complex x); 2. Complex sinh (complex x); 3. Complex tanh (complex x);
  • 10. power function calculates the power of an input number. Syntax :- power( base , exponent);
  • 11. TO CALCULATE POWER OF A ‘DESIRED’ NUMBER TO CALCULATE POWER OF ‘10’  pow  powl  Pow10  Pow10 l
  • 12. Declaration :- •Power :- 1. Double pow (double n , double p ); 2. Long double pow (long double (n) , long double (p 3. Complex pow (complex n , complex p); 4. Complex pow (double n , complex p); 5. Complex pow (complex n , double p); • Power10 :- 1. Double pow10 (int p); 2. Long double pow10 (int (p));
  • 13.  Floor function rounds the value down.  Floor returns integer found as double.  Floorl returns integer found as long double.  Declaration :- double floor (double x); long double floorl(long double (x));
  • 14.  Ceiling function rounds up a number.  Ceil returns an integer found as double.  Ceill returns an integer found as long double. Declaration :- double ceil (double x); long double ceil (long double (x));
  • 15.  Exponential function is used to calculate the powers of ‘e’.  For Real numbers ‘e’ raised to power ‘x’ is calculated.  For complex numbers ‘e’ raised to power ‘z’ is calculated (z is a complex number).
  • 16. Declaration :- • Real :- 1. double exp(double x); 2. long double exp (long double (x)); •Complex :- 1. complex exp(complex (z));
  • 17.  square root function is used to calculate the square root of a given number.  Declaration :-  Real :- double sqrt (double x); long double sqrt (long double (x));  Complex :- complex sqrt (complex x);
  • 18.  absolute value function returns only the numerical value without any sign.  There are different types of abs function :- o abs (a macro) finds absolute value of an integer . o fabs , fabs l (macros) finds absolute values of floating point values. o Cabs , cabs l finds absolute values for complex numbers. o labs finds absolute values for long double values.
  • 19. •Declaration :- •abs :- Real - int abs (int x); Complex - complex abs (complex z); •Fabs , fabd l :- double fabs (double x); long double fabs (long double @E(x)); •Cabs , cabd l :- double cabs (struct_complex z); long double cabd l (struct_complexl z); •Labs :- long int labs(long int x);
  • 20.  This header file contains prepackaged functions to perform various operations on ‘characters’.  To include this header file in the program use the preprocessor directive- # include < ctype.h >
  • 21.  toupper is a function which converts lowercase characters to uppercase characters. If the input character is already uppercase character then those characters remain unchanged.  _toupper is a macro which also converts lowercase characters to uppercase characters. But if the input characters have uppercase characters in it then the result of _toupper is ‘undefined’.
  • 22. •Declarations :- 1. int toupper (char ch); 2. Int _toupper (char ch);
  • 23.  tolower is a function which converts uppercase characters to lowercase characters. If the input character is already lowercase character then those characters remain unchanged.  _tolower is a macro which also converts uppercase characters to lowercase characters. But if the input characters have lowercase characters in it then the result of _tolower is ‘undefined’.
  • 24. •Declarations :- 1. int tolower (char ch); 2. Int _tolower (char ch);
  • 25.  Isspace checks it out whether an input character is a space , tab , carriage return , new line , vertical tab , or formfeed or not.  It is a macro and returns a non-zero value on success.  Declaration :- int isspace ( int c );
  • 26.  The lower order byte of character is in the range 0 to 127.  It is a macro and returns a non-zero value on success.  Declaration :- int isascii (int c);
  • 27.  Isprint checks it out whether the input character is a printing character or not.  It is also a macro and returns a non-zero value on success.  Declaration :- int isprint (int c);
  • 28.  Isgraph checks it out whether input character is a printing character or not like isprint except that space character is excluded.  It is also a macro &returns non-zero value on success.  Declaration :- int isgraph (int c);
  • 29.  iscntrl checks it whether the input character is a delete character or an ordinary control character .  It is also a macro &returns non-zero value on success.  Declaration :- int iscntrl ( int c);
  • 30.  isxdigit checks out whether the input character is a hexadecimal digit or not ( A to F , a to f , 0 to 9).  It is also a macro &returns non-zero value on success.  Declaration :- int isxdigit (int c);
  • 31.  To include this header file in the program use the preprocessor directive- # include < stdlib.h >
  • 32.  Abnormally terminates a process & writes a termination message on stderr(“abnormal program termination “) and then aborts the program by a call to _exit with exit code 3.  Declaration :- void abort (void);
  • 33.  atof converts a sting to floating point value .  _atold converts a string to long double.  Declaration :- double atof (const char *s); long double _atold (const char *(s));
  • 34.  It is a macro that converts the string to integer.  Declaration :- int atoi (const char *s);
  • 35.  Swab function copies nbytes from the “from” string to the “to” string .nbytes should be even .  Adjacent even &odd bytes are swapped.  This is useful for moving data from one machine to another machine in different bytes order.  Declaration :- void swab(char *from, char *to, int nbytes);
  • 36.  System invokes the DOS command interpreter file from inside an executing ‘c’ program to execute a DOS command ,batch file , or other program named by the string “command”.  Declaration :- int system (const char *command);
  • 37.  time.h header file contains various functions operating on time .  Like clock, ctime, stime, time, difftime, acstime, mktime, gmtime, localtime, etc.  To include this header file in the program use preprocessor directive- # include < time.h >
  • 38.  Clock returns the number of clock ticks since program start.  Clock can be used to determine the time interval between two events.  Declaration :- clock_t clock (void);
  • 39.  Asctime converts date and time to ascii.  Ctime converts date and time to a string.  Declaration :- char *acstime (const struct tm *tblock); char *ctime (const time_t *time);
  • 40.  mktime converts time to calendar format .  Declaration :- time_t mktime (struct tm *t);
  • 41.  time gets time of day.  stime gets system date and time.  Declaration :- time_t time (time_t *timer ); int stime (time_t *tp);
  • 42.  Difftime computes difference between 2 times.  Declaration :- double difftime(time_t time2,time_t time1);
  • 43.  Gmtime converts date and time to Greenwich Mean Time (GMT).  Localtime converts date and time to a structure.  Declaration :- struct tm *gmtime(const time_t *timer); struct tm *localtime(const time_t *timer);
  • 44.