Download presentation
Presentation is loading. Please wait.
Published byJosephine McDowell Modified over 6 years ago
1
presented BY : DURGESH KKHANDEKAR 1st semester
BILASPUR UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE & APPLICATION TOPIC: LIBRARY FUNCTION GUIDED BY : JINTENDRA SIR presented BY : DURGESH KKHANDEKAR 1st semester
2
C Standard library function or simply C Library function are inbuilt function in C programming. Function prototype and Data defination of these function are written in their respective header file For example. If you want to use printf() function, the header file <stdio.h> should be included #include<stdio.h> Int main() { /*if you write printf() statement without including header file, this program will show error Printf (“catch me if you can”); }
3
There is at least one function in C i
There is at least one function in C i.e, the main() function (which is also a library function). This program is called at program starts. There are many library function available in C programing to help the programmer to write a good eficient program. Suppose, you want to find the square root of a number. You can write your own piece code to find to square root but, this process is time consuming and the code you have written may not be most efficient process find square root But, in C programing you can find the square root by just using sqrt() function which is defined under header file “math.h”
4
Use of Library function to find square root
#include <stdio.h> #include ><math.h> Int main() { float num,root; Printf(“Enter a number to find square root”); Scanf(“%f”,&num); Root =sqrt(num); /* computer the square root of num and stores in root*/ Printf(“Square root of %.2f=%.2f”,num,root); Return 0; }
5
Important notes C Header files <math.h> <ctype.h>
<stdio.h> <stdlib.h> <string.h> <time.h>
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.