SlideShare a Scribd company logo
1 of 12
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

What's hot

Operators in Python
Operators in PythonOperators in Python
Operators in PythonAnusuya123
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C v_jk
 
Operators in c language
Operators in c languageOperators in c language
Operators in c languageAmit Singh
 
Date and Time Module in Python | Edureka
Date and Time Module in Python | EdurekaDate and Time Module in Python | Edureka
Date and Time Module in Python | EdurekaEdureka!
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentationMartin McBride
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programmingRumman Ansari
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in CHarendra Singh
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member FunctionsMuhammad Hammad Waseem
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programmingprogramming9
 

What's hot (20)

Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Functions in c
Functions in cFunctions in c
Functions in c
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 
File in C language
File in C languageFile in C language
File in C language
 
C functions
C functionsC functions
C functions
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
Date and Time Module in Python | Edureka
Date and Time Module in Python | EdurekaDate and Time Module in Python | Edureka
Date and Time Module in Python | Edureka
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Python Control structures
Python Control structuresPython Control structures
Python Control structures
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentation
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
 
File handling in C
File handling in CFile handling in C
File handling in C
 
class and objects
class and objectsclass and objects
class and objects
 
Strings in C
Strings in CStrings in C
Strings in C
 
Storage classes in C
Storage classes in CStorage classes in C
Storage classes in C
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 

Similar to Header files in c

Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library FunctionDeepak Singh
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3MOHIT TOMAR
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3MOHIT TOMAR
 
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
 
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
 

Similar to Header files in c (20)

Built in function
Built in functionBuilt in function
Built in function
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library Function
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
 
Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3Header files of c++ unit 3 -topic 3
Header files of c++ unit 3 -topic 3
 
Unit2 input output
Unit2 input outputUnit2 input output
Unit2 input output
 
Functions
FunctionsFunctions
Functions
 
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
 
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...
 
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
 
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
 
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
 
C Language Lecture 16
C Language Lecture 16C Language Lecture 16
C Language Lecture 16
 
C function
C functionC function
C function
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Function
FunctionFunction
Function
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
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
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.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 🔝✔️✔️
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 

Header files in c

  • 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; }