JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: C Language in hindi

Header File – stdlib.h in c language in hindi , हैडर फाइल : stdlib.h क्या है , कंप्यूटर भाषा हिंदी में

हैडर फाइल : stdlib.h क्या है , कंप्यूटर भाषा हिंदी में , Header File – stdlib.h in c language in hindi :-
stdlib.h header file मे सभी यूटिलिटी function का store किया जाता  है |Utility function का use  कंप्यूटर के untility task मे किया जाता है |इस header file मे , निन्म functions होते हो :-
1. abs()
इस function का use किसी variable की absolute value के लिए किया जाता है |absolute value हमेशा positive होती है |इसमें हमेशा integer type variable ही pass होता है |
इसका उदाहरण है :-
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int a= abs(500)
int b=abs(-600);
int c=a-b;
printf(“absolute value of a is %d”,a);
printf(“absolute value of d is %d”,b);
printf(“a-b is %d”,abs(c));
getch();
}आउटपुट होगा :-
absolute value of a is 500
absolute value of d is 600
a-b is 100
अतः यहा पर a-b का आउटपुट -100 होगा लेकिन abs(c) function से 100 ही print होगा |

2.atof()
इस function का use string को float या double मे convert किया जाता है |इस function मे string को function parameter के तरह pass किया जाता है | और आउटपुट मे double type value मिलती है |string मे कोई भी white space नहीं आना चाहिए क्योकि अगर string मे white space आ जाता है तो वो double / floating मे convert नहीं हो सकता है |
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int r;
float arae;
char gravity[ ]= ‘9.8’;
int pi=’3.145′;
printf(“Enter radius”);
scnaf(“%d”,&r);
float g=atof(gravity);
float p=atof(pi);
printf(“value of gravity = %f”,g);
printf(“value of pi = %f”,p);
arae = p*r*r;
printf(“Area = %f “,area );
getch();
}

इस उदहारण मे , string pi की value को float मे convert करके ‘p’ मे store कर देते है |id float variable ‘p’ को area के formula मे pi की value की तरह use किया जाता है |

आउटपुट होगा :
Enter radius 3
value of gravity = 9.8
value of pi = 3.145
Area = 29.67

3.atoi()
इस function का use string को integer मे convert किया जाता है |इस function मे string को function parameter के तरह pass किया जाता है | और आउटपुट मे integer  type value मिलती है |string मे कोई भी white space नहीं आना चाहिए क्योकि अगर string मे white space आ जाता है तो वो integer मे convert नहीं हो सकता है |
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int b , area;
char gravity[ ]= ’10’;
int length=’20’;
printf(” Enter Breath “);
scnaf(“%d”,&b);
int g=atoi(gravity);
int l =atoi(length);
printf(“value of gravity = %d”,g);
printf(“value of length= %d”,l);
arae = l*b;
printf(“Area = %d “,area );
getch();
}

इस उदहारण मे , string length की value को integer मे convert करके ‘l’ मे store कर देते है |इस integer  variable ‘l’ को area के formula मे length की value की तरह use किया जाता है |

आउटपुट होगा :
Enter Breath 3
value of gravity = 10
value of length = 20
Area = 60

4.atol()
इस function का use string को long integer मे convert किया जाता है |इस function मे string को function parameter के तरह pass किया जाता है | और आउटपुट मे long integer  type value मिलती है |string मे कोई भी white space नहीं आना चाहिए क्योकि अगर string मे white space आ जाता है तो वो long integer मे convert नहीं हो सकता है |
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int b , area;
char gravity[ ]= ’10’;
int length=’20’;
printf(” Enter Breath “);
scnaf(“%d”,&b);
int g=atol(gravity);
int l =atol(length);
printf(“value of gravity = %ld”,g);
printf(“value of length= %ld”,l);
arae = l*b;
printf(“Area = %d “,area );
getch();
}इस उदहारण मे , string length की value को long  integer मे convert करके ‘l’ मे store कर देते है |इस long integer variable ‘l’ को area के formula मे length की value की तरह use किया जाता है |

आउटपुट होगा :
Enter Breath 3
value of gravity = 10
value of length = 20
Area = 60

5.calloc()
calloc () function का use , ,किसी array के लिए memory space को allocate करने के लिए किया जाता है |इसमें दो parameter pass होते है |
(i) Number of array element| इसका number integer होता है |
(ii) size of each element in array|इअका value byte मे होती है |
इस function से pointer address return होता है जो की allocate memory के address को hold करता है |
इस function को हम dynamic memory allocation मे अच्छी तरह पढ़ चुके है |
उदाहरण के लिए :
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int *a;
a=(int *) calloc(5,sizeof(int));
for(int i=0;i<5;i++)
{
printf(“\n Enter element i :  “);
scanf(“%d”,&a[i]);
}
for(i=0;i<5;i++)
{
printf(“\nElement = %d\n”,a[i]);
}
getch();
}

आउटपुट होगा ;

Enter element 0 :23
Enter element 1 :43
Enter element 2 :56
Enter element 3 :67
Enter element 4 :70
Element = 23
Element = 43
Element = 56
Element = 67
Element = 70


6.exit()
इस function का सभी file और buffer को क्लोज करने के लिए किया जाता है |इसके अलावा प्रोग्राम को terminate करने के लिए किया जाता है |ये c प्रोजेक्ट मे सबसे ज्यादा use आने वाला function होता है |इसका उदहारण है :-
#inlcude<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int a,b,c;
printf(“enter your inputs”);
scanf(“%d %d”,&a,&b);
printf(“variable A=%d”,a);
peinrf(“variable B=%d”,b);
exit();
c=a+b;
printf(“Sum=%d”,c);
getch();
}

आउटपुट होगा :
enter your inputs 12 22
variable A=12
variable B=22
इस उदाहरण मे , sum operation perform नहीं हो सकता है |और इसका आउटपुट print नहीं होगा |

7.melloc()
malloc () function का use , ,किसी array के लिए memory space को allocate करने के लिए किया जाता है |इसमें एक parameter pass होते है |
(i) size of each element in array|इअका value byte मे होती है |
इस function से pointer address return होता है जो की allocate memory के address को hold करता है |
इस function को हम dynamic memory allocation मे अच्छी तरह पढ़ चुके है |
उदाहरण के लिए :
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int *a;
a=(int *) malloc(sizeof(int)*5);
for(int i=0;i<5;i++)
{
printf(“\n Enter element i :  “);
scanf(“%d”,&a[i]);
}
for(i=0;i<5;i++)
{
printf(“\nElement = %d\n”,a[i]);
}
getch();
}

आउटपुट होगा ;

Enter element 0 :23
Enter element 1 :43
Enter element 2 :56
Enter element 3 :67
Enter element 4 :70
Element = 23
Element = 43
Element = 56
Element = 67
Element = 70

8.rand()
इस function का use random value generate करने के लिए किया जाता है |जब हमे किसी random number को generate करते है तब प्रत्येक बार एक ही random number के sequence को generate करता है |
उदहारण के लिए :
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int a[5];
for(int i=0;i<5;i++)
{
printf(“random number = %d\n”,rand());
}
getch();
}
आउटपुट होगा
random number = 954
random number = 2343
random number = 3435
random number = 123
random number = 6542
जब प्रोग्राम को दुसरे बाद run करते है तब आउटपुट same आयेगे |
random number = 954
random number = 2343
random number = 3435
random number = 123
random number = 6542

9.srand()
इस function का use ,random number के लिए initial value को set करने की लिए किया जाता है |अगर srand() को call नहीं करते तब random number के seed set होती और हर बार seed की value same होती है |
लेकिंग जब srand() function को call करते है तब random number की seed change हो जाती है |
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int a[5];
srand(time(0));
for(int i=0;i<5;i++)
{
printf(“random number = %d\n”,rand());
}
getch();
}
आउटपुट होगा
random number = 954
random number = 2343
random number = 3435
random number = 123
random number = 6542
जब प्रोग्राम को दुसरे बाद run करते है तब आउटपुट अलग आयेगे |
random number = 1232
random number = 346
random number = 455
random number = 4563
random number = 6565

Sbistudy

Recent Posts

द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi

अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…

12 hours ago

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

3 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

5 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

1 week ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

1 week ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now