हिंदी माध्यम नोट्स
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
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
String : Functions in c computer language definition in hindi स्ट्रिंग क्या है c भाषा में कंप्यूटर हिंदी में
किसी character को integer मे चगे करने के लिए प्रोग्राम है |
#include<conio.h>
#include<stdio.h>
void main()
{
char a=’b’;
printf(“Asiic value of b is %d”,a);
getch();
}आउटपुट होगा :
Asiic value of b is 98किसी character पर arithmetic operation भी perform कर सकते है | Arithmetic operation मे character की ASIIC value के साथ कैलकुलेशन होती है |जैसे :#include<conio.h>
#include<stdio.h>
void main()
{
char a=’b’;
char y;
y=’a’+1;
printf(“Asiic value of b is %d”,a);
printf(“%c”,y)
printf(“Asiic value of b is %d”,y);
getch();
}
इस उदहारण मे , b की ASIIC value 98 है, y=’a’+1; statement से y की ASIIC value 98+1=99 हो जाएगी |printf(“%c”,y) से 99 ASIIC value वाला character print होगा |
आउटपुट होगा :
Asiic value of b is 98
c
Asiic value of b is 99
1.atoi() function
इस function से किसी digits के string को integer को convert कर सकते है |जैसे
#include<conio.h>
#include<stdio.h>
void main()
{
char a=’2019′;
int b;
b=atoi(a);
printf(“%d”,b);
getch();
}
इस उदाहारण मे ‘2019’ जो की एक string है b=atoi(a); statement से integer मे convert हो गयी जो की integer variable b मे store हो जाती है |
ओउपुत होगा :
2019
String Comparison :
#include<stdio.h>
void main()
{
char a[10],b[10];
int i;
printf(“enter your string 1”);
gets(a);
printf(“enter your string 2”);
gets(b);
if(strcmp(a,b)==1)
{
printf(“Strings are not same .”);
}
else
{printf(“Strings are same .”);
getch();
}
string_name 1,string_name 2 दो charter array होती है |जब strcat () function execute होगा string_name 2 ,string_name 1 के बाद write होगा |string_name 1 मे null charter को डिलीट करके string_name 2 को insert किया जाता है |
और string_name 1 की size इतनी होनी चाहिए की string_name 2 के chartercet insert हो जाये |
उदहारण के लिए :
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
printf(“enter your string 2”);
gets(b);
strcat(a,b);
printf(“%s”,a);
getch(();
}
आउटपुट होगा :
इस function से दो strings को ही नहीं string constant को भी add कर सकते है |उदाहरण के लिए:
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
strcat(a,Hello!);
printf(“%s”,a);
getch(();
}
ओउपुत होगा :
enter your string 1 Parth
ParthHello!
String Copy :
String copy function strcpy() का use किसी string को दुसरे string मे copy करने के लिए किया जाता है |इसका syntax है :-
strcpy(string_name 1,string_name 2);
और string_name 1 की size इतनी होनी चाहिए की string_name 2 के charterer,string_name 1 मे copy हो जाये |उदहारण के लिए:
#include<conio.h>
#include<stdio.h>
void main()
{
char a[15],b[10];
printf(“enter your string 1”);
gets(a);
printf(“Before Coping=%s”,a);
printf(“enter your string 2”);
gets(b);
strcpy(a,b);
printf(“After Coping=%s”,a);
getch(();
}
आउटपुट होगा :
String Length:
#include<stdio.h>
void main()
{
char a[15];
printf(“enter your string “);
gets(a);
int length;
length=strlen(a);
printf(“Size of string=%d”,length);
getch();
}आउटपुट होगा :
enter your string Parth
Size of string=5इसके next article मे इस अभी function को for loop और pre define function के अलावा प्रोग्राम को discuss करेगे |
Recent Posts
द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन क्या हैं differential equations of second order and special functions in hindi
अध्याय - द्वितीय कोटि के अवकल समीकरण तथा विशिष्ट फलन (Differential Equations of Second Order…
नियत वेग से गतिशील बिन्दुवत आवेश का विद्युत क्षेत्र ELECTRIC FIELD OF A POINT CHARGE MOVING WITH CONSTANT VELOCITY in hindi
ELECTRIC FIELD OF A POINT CHARGE MOVING WITH CONSTANT VELOCITY in hindi नियत वेग से…
four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं
चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…
Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा
आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…
pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए
युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…
THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा
देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…