Library Functions in C language

Introduction

जब हम C language में program लिखते हैं, तो हर छोटी-छोटी चीज़ के लिए code लिखना समय लेने वाला और कठिन हो सकता है।

इस समस्या को हल करने के लिए C language में पहले से बने हुए कुछ functions दिए गए हैं, जिन्हें हम सीधे use कर सकते हैं।
इन functions को Library Functions कहा जाता है।

ये functions programming को आसान, तेज और efficient बनाते हैं।


Definition

Library Functions वे predefined functions होते हैं जो C language की libraries में पहले से मौजूद होते हैं और जिन्हें हम अपने program में उपयोग कर सकते हैं।


Example

#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}

👉 यहाँ:

  • printf() → Library Function है
  • stdio.h → header file (library) है

Some Common Library Functions

FunctionUse
printf()Output दिखाने के लिए
scanf()Input लेने के लिए
strlen()String की length निकालने के लिए
sqrt()Square root निकालने के लिए
pow()Power निकालने के लिए

Real World Example

मान लो आप एक restaurant में जाते हैं:

  • आपको खुद खाना बनाने की जरूरत नहीं होती
  • आप menu से खाना order करते हैं और ready-made food मिल जाता है

इसी तरह:

  • Library Functions → ready-made functions हैं
  • आपको सिर्फ use करना होता है, बनाने की जरूरत नहीं होती

Important Note

  • Library functions को use करने के लिए header file include करना जरूरी है
  • जैसे:
    • stdio.h → input/output
    • math.h → mathematical functions

Exam Points

  • Library functions predefined होते हैं
  • ये header files में defined होते हैं
  • Programming को आसान और fast बनाते हैं
  • printf() और scanf() सबसे common हैं

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top