C String in Hindi | String functions with examples in c

C String in Hindi :- String is a group Of Character hai or use double quote se defined kiya jata hai |

C String ko samanjh ne ke liye ham iske A to Z examples ko dekhte hai.

String in c programming with examples

String In C

Syntax :

"string"
var1 = " Danish "

Different Constant Values Contained inside String

String with Single Character

"D"

String With Multiple Characters

"Danish Ali"

String With Digits

"123456789"

String With Blanks

"How are You Guys"

String in c in Hindi Ko Samanjh Ne Kiye Liye Ham Iske Example 1 ko dekhte hai |

Example Program 1:

#include<stdio.h>
#include<conio.h>

  int main()
   {
      char stu[10];         // yha par 10 char le sakte hai
      printf("Enter Your Name :");
      scanf("%s",&stu);

      printf("Your Name Is %s",stu);
      getch();
  }

Upper Diye Program ko dekh kar aap program ko samanjh sakte hai & ( %s ) string ke liye istemal hota hai |

Output

Enter Your Name :Danish Ali
Your Name Is Danish Ali

String In Built Function in c

String in c me in built function hai jo aap niche diye list me dekh sakte hai|

String In Built Function Istemal Karne ke liye aapko Header File #include < string.h> ka istemal karna padega |

  • strlen() // string lenth find karne ke liye
  • strrev() // string ko reverse karne ke liye
  • strcam() // string ko campare karne ke liye
  • strcat() // string ko concatenation karne ke liye
  • strcpy() // string ko copy karne ke liy

Upper Diye sting in built function ko example ke sath samanjh te hai |

Strlen() in c Program Example :

Strlen() function in c :- strlen() function se ham string ki length pta karte hai or strlen function keval ek string argument leta hai & integer value return karta hai |

Example Strlen() :

#include<stdio.h>
#include<conio.h>
#include<string.h>

  int main()
   {
      char stu[10];     
      int len_name;
    
      printf("Enter Your Name :");
      scanf("%s",&stu);
      printf("Your Name Is %s \n",stu);

      len_name = strlen(stu);

      printf("Length String : %d",len_name);
      getch();
  }

Output:

Enter Your Name :Danish
Your Name Is Danish

Length String : 6

Strrev() in c Program Example :

Strrev() function in c :- strrev() function se ham string ko Reverse kar sakte hai Example : Danish , reverse is hsinaD | & strrev() keval ek string argument leta hai or return string hi karta hai |

Example Strrev():

#include<stdio.h>
#include<conio.h>
#include<string.h>

  int main()
   {
      char stu[10];     
      char Rev_name;
    
      printf("Enter Your Name :");
      scanf("%s",&stu);
      printf("Your Name Is %s \n",stu);

      Rev_name = strlen(stu);
      printf("Reverse String is : %s",Rev_name);
      getch();
  }

Output:

Enter Your Name :Danish
Your Name Is Danish 

Reverse String is : hsinaD

Strcam() in c Program Example :

Strcam() function in c :- strcam() function se ham string ko compare kar sakte hai | & strcam() 2 string argument leta hai |

Example Strcam():

#include<stdio.h>
#include<conio.h>
#include<string.h>

  int main()
   {
      char stu1[10], stu2[10];     
      char cam_name;
    
      printf("Enter Your Name to Compare :");
      scanf("%s",&stu1);

      printf("Enter Your Name to Compare :");
      scanf("%s",&stu2);

      printf("Your Name Is %s \n",stu1);
      printf("Your Name Is %s \n",stu2);

      if(strcam(stu1,stu2) == 0)
      {
         printf("Same String ")
      }
      else
      {
         printf("Not Same String")
      }
     
      getch();
  }

Output:

Enter Your Name to Compare :Danish
Enter Your Name to Compare :Danish

Your Name Is Danish
Your Name Is Danish

Same String

Strcat() in c Program Example :

Strcat() function in c :- strcat() function se ham 2 string ko jod ya (add) kar sakte hai or strcat function 2 string argument leta hai & string value return karta hai |

Example Strcat() :

#include<stdio.h>
#include<conio.h>
#include<string.h>

  int main()
   {
      char stu1[10];     
      char stu2[10];
      char cat_name;
 
      stu1 = "Danish"
      stu2 = " Ali"

      cat_name = strcat(stu1,stu2);
      printf("Concatenation two string is  : %s",cat_name);
      getch();
  }

Output:

Concatenation two string is  : Danish Ali

Strcpy() in c Program Example :

Strcpy() function in c :- strcpy() function se ham string ko copy kar sakte hai or strcpy function 2 string argument leta hai & string value return karta hai |

Example Strcpy() :

#include<stdio.h>
#include<conio.h>
#include<string.h>

  int main()
   {
      char stu1[10];     
      char stu2[10];
      char copy_name;
 
      stu1 = "Danish"
      stu2 = " Ali"

      strcpy(stu1,stu2);

      printf("Copy String is  : %s",stu1);
      getch();
  }

Output:

Copy String is : Danish Ali

C String in Hindi | string functions with examples in c

Dosto mujhe ummed hai ki aap string functions with examples in ci  ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Summary
Review Date
Reviewed Item
C String in Hindi | String functions with examples in c
Author Rating
51star1star1star1star1star

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

0 thoughts on “C String in Hindi | String functions with examples in c

Leave a Reply

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

error

Enjoy this blog? Please spread the word :)