SlideShare a Scribd company logo
1 of 12
Download to read offline
HEADER FILES IN C
Presented by: Prajjawal Rao Chintal
WHAT IS A HEADER FILE
Header file included at the top of any
C program.
Syntax: #include <file>
All the header file have a '.h' an
extension that contains C function
declaration
Header files are imported into C
program with the help of pre-
processor #include statement
VARIOUS SYSTEM HEADER FILES
name discription
<stdio.h> Input/Output Functions
<conio.h> console input/output
<math.h> Mathematics Functions
<time.h> Date and Time Functions
<string.h> String Functions
<stdlib.h> General Utility Functions
<complex.h> A set of function for manipulating complex
numbers
<ctype.h> Character handling functions
<assert.h> Diagnostics Functions
 The C programming language provides many standard
library functions for file input and output.
<stdio.h> functions
function discription
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.
Fopen() Opens a file
Fclose() Close an opened file
Gets() It reads line from keyboard
 conio.h header used in C programming contains
functions for console input/output
<conio.h> functions
function discription
Clrscr() This function is used to clear the
output screen.
Getch() It reads character from keyboard
Getche() It reads character from keyboard
and echoes to o/p screen
Textcolor() This function is used to change the
text color
Textbackground() This function is used to change text
background
 Example of printf() ,scanf() ,getch() and clrscr ()
functions.
#include <stdio.h>
#include <conio.h>
int main()
{
int num1, num2, sum;
clrscr();
printf("Enter any two numbers : n");
scanf("%d%d", &num1, &num2);
sum = num1 + num2;
printf("Sum = %d",sum);
getch();
return 0;
}
 math.h header file supports all the mathematical
related functions in C language.
<math.h> functions
Function Discription
Pow() This is used to find the power of the given number.
Sqrt() This function is used to find square root of the
argument passed to this function.
Log() This function is used to calculates natural logarithm.
Exp() This function is used to calculate the exponential “e”
to the xth power.
Log10() This function is used to calculates base 10 logarithm.
Floor() This function returns the nearest integer which is less
than or equal to the argument passed to this function.
 Example of math.h
#include <stdio.h>
#include <math.h>
int main ()
{
printf("Value 8.0 ^ 3 = %lfn", pow(8.0, 3));
printf("Value 3.05 ^ 1.98 = %lf", pow(3.05, 1.98));
return(0);
}
 Time functions in C are used to interact with system
time routine and formatted time outputs are
displayed
.
<time.h> functions
function discription
Getdate() This function is used to get the CPU time
Setdate() This function used to modify the system
date
Clock() This function is used to get current
system time
Time() This function is used to get current
system time as structure
 Example program for<time.h>
#include<stdio.h>
#include<time.h>
#include<dos.h>
int main()
{
struct date dt;
getdate(&dt);
printf("Operating system's current date is %d-%d-
%dn",dt.da_day,dt.da_mon,dt.da_year);
return 0;
}
 , C supports a large number of string handling
functions in the standard library "string.h".
<string.h> functions
function discription
Strlen() Calculates the length of string
Strcpy() Copies a string to another string
Strcmp() Concatenates(joins) two strings
Strcat() Compares two string
Strlwr() Converts string to lowercase
Strupr() Converts string to uppercase
 Example of strncat:
#include <stdio.h>
#include <string.h>
int main()
{
char s1[10] = "Hello";
char s2[10] = "World";
strncat(s1,s2, 3);
printf("Concatenation using strncat: %s", s1);
return 0;
}

More Related Content

Similar to C Header Files

Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Edureka!
 
Input and Output In C Language
Input and Output In C LanguageInput and Output In C Language
Input and Output In C LanguageAdnan Khan
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdfsimenehanmut
 
Functions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxFunctions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxvanshhans21102005
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212Mahmoud Samir Fayed
 

Similar to C Header Files (20)

unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
Input and Output In C Language
Input and Output In C LanguageInput and Output In C Language
Input and Output In C Language
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
C function
C functionC function
C function
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. AnsariBasic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
Functions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxFunctions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptx
 
Python Lecture 4
Python Lecture 4Python Lecture 4
Python Lecture 4
 
Function
FunctionFunction
Function
 
C Language Lecture 16
C Language Lecture 16C Language Lecture 16
C Language Lecture 16
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Functions struct&union
Functions struct&unionFunctions struct&union
Functions struct&union
 
CHAPTER 6
CHAPTER 6CHAPTER 6
CHAPTER 6
 
Python_Functions_Unit1.pptx
Python_Functions_Unit1.pptxPython_Functions_Unit1.pptx
Python_Functions_Unit1.pptx
 
Functions in C.pptx
Functions in C.pptxFunctions in C.pptx
Functions in C.pptx
 
The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212The Ring programming language version 1.10 book - Part 35 of 212
The Ring programming language version 1.10 book - Part 35 of 212
 

Recently uploaded

Freegle User Survey as visual display - BH
Freegle User Survey as visual display - BHFreegle User Survey as visual display - BH
Freegle User Survey as visual display - BHbill846304
 
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130Suhani Kapoor
 
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service Bikaner
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service BikanerLow Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service Bikaner
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service BikanerSuhani Kapoor
 
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...Suhani Kapoor
 
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...ranjana rawat
 
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...Call Girls in Nagpur High Profile
 
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Sustainable Clothing Strategies and Challenges
Sustainable Clothing Strategies and ChallengesSustainable Clothing Strategies and Challenges
Sustainable Clothing Strategies and ChallengesDr. Salem Baidas
 
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Standkumarajju5765
 
Booking open Available Pune Call Girls Parvati Darshan 6297143586 Call Hot I...
Booking open Available Pune Call Girls Parvati Darshan  6297143586 Call Hot I...Booking open Available Pune Call Girls Parvati Darshan  6297143586 Call Hot I...
Booking open Available Pune Call Girls Parvati Darshan 6297143586 Call Hot I...Call Girls in Nagpur High Profile
 
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashik
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service NashikRussian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashik
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashikranjana rawat
 
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Freegle User Survey as visual display - BH
Freegle User Survey as visual display - BHFreegle User Survey as visual display - BH
Freegle User Survey as visual display - BH
 
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130
VIP Call Girls Service Bandlaguda Hyderabad Call +91-8250192130
 
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service Bikaner
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service BikanerLow Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service Bikaner
Low Rate Call Girls Bikaner Anika 8250192130 Independent Escort Service Bikaner
 
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service
(ZARA) Call Girls Talegaon Dabhade ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...
VIP Call Girls Saharanpur Aaradhya 8250192130 Independent Escort Service Saha...
 
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Aditi Call 7001035870 Meet With Nagpur Escorts
 
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
(PARI) Viman Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune ...
 
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...
VVIP Pune Call Girls Koregaon Park (7001035870) Pune Escorts Nearby with Comp...
 
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(AISHA) Wagholi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Sustainable Clothing Strategies and Challenges
Sustainable Clothing Strategies and ChallengesSustainable Clothing Strategies and Challenges
Sustainable Clothing Strategies and Challenges
 
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Preet Vihar ☎ 9711199171 Book Your One night Stand
 
Booking open Available Pune Call Girls Parvati Darshan 6297143586 Call Hot I...
Booking open Available Pune Call Girls Parvati Darshan  6297143586 Call Hot I...Booking open Available Pune Call Girls Parvati Darshan  6297143586 Call Hot I...
Booking open Available Pune Call Girls Parvati Darshan 6297143586 Call Hot I...
 
E Waste Management
E Waste ManagementE Waste Management
E Waste Management
 
Call Girls In R.K. Puram 9953056974 Escorts ServiCe In Delhi Ncr
Call Girls In R.K. Puram 9953056974 Escorts ServiCe In Delhi NcrCall Girls In R.K. Puram 9953056974 Escorts ServiCe In Delhi Ncr
Call Girls In R.K. Puram 9953056974 Escorts ServiCe In Delhi Ncr
 
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashik
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service NashikRussian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashik
Russian Call Girls Nashik Anjali 7001305949 Independent Escort Service Nashik
 
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(RIYA) Kalyani Nagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service
(ANAYA) Call Girls Hadapsar ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls In { Delhi } South Extension Whatsup 9873940964 Enjoy Unlimited Pl...
Call Girls In { Delhi } South Extension Whatsup 9873940964 Enjoy Unlimited Pl...Call Girls In { Delhi } South Extension Whatsup 9873940964 Enjoy Unlimited Pl...
Call Girls In { Delhi } South Extension Whatsup 9873940964 Enjoy Unlimited Pl...
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
 
young Whatsapp Call Girls in Delhi Cantt🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Delhi Cantt🔝 9953056974 🔝 escort serviceyoung Whatsapp Call Girls in Delhi Cantt🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Delhi Cantt🔝 9953056974 🔝 escort service
 

C Header Files

  • 1. HEADER FILES IN C Presented by: Prajjawal Rao Chintal
  • 2. WHAT IS A HEADER FILE Header file included at the top of any C program. Syntax: #include <file> All the header file have a '.h' an extension that contains C function declaration Header files are imported into C program with the help of pre- processor #include statement
  • 3. VARIOUS SYSTEM HEADER FILES name discription <stdio.h> Input/Output Functions <conio.h> console input/output <math.h> Mathematics Functions <time.h> Date and Time Functions <string.h> String Functions <stdlib.h> General Utility Functions <complex.h> A set of function for manipulating complex numbers <ctype.h> Character handling functions <assert.h> Diagnostics Functions
  • 4.  The C programming language provides many standard library functions for file input and output. <stdio.h> functions function discription 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. Fopen() Opens a file Fclose() Close an opened file Gets() It reads line from keyboard
  • 5.  conio.h header used in C programming contains functions for console input/output <conio.h> functions function discription Clrscr() This function is used to clear the output screen. Getch() It reads character from keyboard Getche() It reads character from keyboard and echoes to o/p screen Textcolor() This function is used to change the text color Textbackground() This function is used to change text background
  • 6.  Example of printf() ,scanf() ,getch() and clrscr () functions. #include <stdio.h> #include <conio.h> int main() { int num1, num2, sum; clrscr(); printf("Enter any two numbers : n"); scanf("%d%d", &num1, &num2); sum = num1 + num2; printf("Sum = %d",sum); getch(); return 0; }
  • 7.  math.h header file supports all the mathematical related functions in C language. <math.h> functions Function Discription Pow() This is used to find the power of the given number. Sqrt() This function is used to find square root of the argument passed to this function. Log() This function is used to calculates natural logarithm. Exp() This function is used to calculate the exponential “e” to the xth power. Log10() This function is used to calculates base 10 logarithm. Floor() This function returns the nearest integer which is less than or equal to the argument passed to this function.
  • 8.  Example of math.h #include <stdio.h> #include <math.h> int main () { printf("Value 8.0 ^ 3 = %lfn", pow(8.0, 3)); printf("Value 3.05 ^ 1.98 = %lf", pow(3.05, 1.98)); return(0); }
  • 9.  Time functions in C are used to interact with system time routine and formatted time outputs are displayed . <time.h> functions function discription Getdate() This function is used to get the CPU time Setdate() This function used to modify the system date Clock() This function is used to get current system time Time() This function is used to get current system time as structure
  • 10.  Example program for<time.h> #include<stdio.h> #include<time.h> #include<dos.h> int main() { struct date dt; getdate(&dt); printf("Operating system's current date is %d-%d- %dn",dt.da_day,dt.da_mon,dt.da_year); return 0; }
  • 11.  , C supports a large number of string handling functions in the standard library "string.h". <string.h> functions function discription Strlen() Calculates the length of string Strcpy() Copies a string to another string Strcmp() Concatenates(joins) two strings Strcat() Compares two string Strlwr() Converts string to lowercase Strupr() Converts string to uppercase
  • 12.  Example of strncat: #include <stdio.h> #include <string.h> int main() { char s1[10] = "Hello"; char s2[10] = "World"; strncat(s1,s2, 3); printf("Concatenation using strncat: %s", s1); return 0; }