This presentation introduces built-in functions in C programming. It defines built-in functions as functions provided by the C library that perform common tasks like file access, math operations, and graphics without needing to be defined by the programmer. It provides examples of commonly used built-in functions from header files like stdio.h for input/output, string.h for string manipulation, and math.h for math functions. The presentation concludes by noting advantages like code reusability but also potential disadvantages like increased complexity from functions.
3. FUNCTION :
A function is a group of statements that together perform
a task.
A function is a block of code that performs a calculation
and returns a value.
Every C program has at least one function, which
is main()
5. WHAT IS LIBRARY FUNCTION OR
BUILT-IN FUNCTION??
Built in functions are the functions that are provided by
C library.
These functions perform file access, mathematical
computations, graphics, memory management etc.
Defined in a special header file.
A function that is built into an application and can be
accessed by end-users.
6. BUILT-IN FUCTION HEADER FILES:
<stdio.h> : Standard input/output.
<conio.h> : This is console input/output header file.
<string.h> : All string related functions are defined in
this header file.
<math.h> : All maths related functions are defined
in this header file
<time.h> : Time and clock related functions
7. <STDIO.H> LIBRARY FUNCTIONS SOURCE CODE :
printf() : This function is used to print the character,
string, float, integer, octal and hexadecimal values onto
the output screen.
scanf() : This function is used to read a character,
string, numeric data from keyboard.
getc() : It reads character from file
gets() : It reads line from keyboard
getchar() : It reads character from keyboard
putchar() : It writes a character to screen
8. getw() : reads an integer from file
putw() : writes an integer to file
fgetc() : reads a character from file
putc() : writes a character to file
feof() : finds end of file
fprintf() : writes formatted data to a file
fscanf(): reads formatted data from a file
fgetchar : reads a character from keyboard
Fputchar : writes a character from keyboard
9. <CONIO.H> LBRARY FUNCTIONS SOURCE CODE :
clrscr() : This function is used to clear the output
screen.
getch() : It reads character from keyboard
textcolor() : This function is used to change the
text color
textbackground() : This function is used to
change text background
10. <STRING.H> LIBRARY FUNCTIONS SOURCE CODE:
strcat(str1, str2) : Concatenates str2 at the end of str1.
strcpy(str1, str2) : Copies str2 into str1
strlen(strl) : gives the length of str1.
strcmp(str1, str2) : Returns 0 if str1 is same as
str2. Returns <0 if strl < str2. Returns >0 if str1 > str2.
strdup() : duplicates the string
strlwr() : converts string to lowercase
11. <MATH.H> LIBRARY FUNCTIONS SOURCE CODE :
sin( ) : This function is used to calculate sine value.
cos( ) : This function is used to calculate cosine.
tan( ) : This function is used to calculate tangent.
log( ) : This function is used to calculates natural
logarithm.
pow( ) : This is used to find the power of the given
number.
12. <TIME.H> LIBRARY FUNCTIONS SOURCE CODE :
setdate() : This function used to modify the system date
getdate() : This function is used to get the CPU time
clock() : This function is used to get current system time
time() : This function is used to get current system time
as structure
difftime() : This function is used to get the difference
between two given times
13. ADVANTAGES :
It helps in making the code very simple and much
more easier to handle.
A function may be used by many other programs.
You can use it over and over without retyping the
code
Less code for more
Helps organize your code
14. DISADVANTAGES:
I think functions are sometimes difficult to handle
and can confuse the programmer in handling
different tasks.
15. PROGRAMING IN BUILT-IN FUNCTION :
#include<stdio.h>
main()
{
printf ("Welcome To Your Presentation");
}
Sample Output :