String Functions In C & string.h Library: C Tutorial In Hindi #35

  Рет қаралды 271,954

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 320
@fullygaming3647
@fullygaming3647 2 жыл бұрын
Sir, This is the answer of the quiz #include #include int main() { char s1[20]; char s2[20]; char s3[30] = " is a frind of "; printf("Enter the name of first friend "); gets(s1); printf("Enter the name of second friend "); gets(s2); puts(strcat(s1, (strcat(s3, s2)))); return 0; }
@jatintomar8170
@jatintomar8170 7 ай бұрын
// char s1[20]; // char s2[] = " is a friend of "; // // char s3[40]; // char s4[20]; char s1[20]; // char s2[40]; char s3[20]; char s4[] = " is a friend of "; printf("Enter your name: "); gets(s1); printf("Enter your friend's name: "); gets(s3); // strcpy(s2 ,strcat(s1, s4)); // puts(strcat(s2, s3)); puts(strcat(s1, (strcat(s4, s3))));
@_Ojasmahajan
@_Ojasmahajan Жыл бұрын
Sir your channel has helped me understand much better than Apna college because you explain all of the basics which a beginner could face difficulty in understanding.I am glad I found your channel
@supzzz04
@supzzz04 7 ай бұрын
you are exactly right .I was also struggling with apna college video but Sir 's videos are amazing easy to understand and remember
@arkabhattacharya3379
@arkabhattacharya3379 3 жыл бұрын
Two things to keep in mind would be strrev() has been removed from gcc and gets() has been removed from c11, so write your own code to reverse a string either using loops or recursion as per your choice, using gets() might give a warning so we can use the following to take a string input from the user until a new-line element is encountered :- i) scanf("%[^ ]%*c", str); ii) scanf("%[^ ]s",str); where [] is the scanset character. hope this helps. btw the content is great.
@thesmartone6601
@thesmartone6601 2 жыл бұрын
Bro I am not getting your code for how %/n and %*c is used? Can you please explain your code more clearly?
@BM-we4ij
@BM-we4ij 2 жыл бұрын
Hi, do u mean to say, we cannot not use (strrev) to reverse now?? Bcz I am getting error....
@N-methyl1phenylpropan-2-amine
@N-methyl1phenylpropan-2-amine 2 жыл бұрын
Or you could just use fgets()
@chirntn
@chirntn Жыл бұрын
rather , use fgets char s1[10]; fgets(s1, size0f(s1),stdin);
@mrbadshaah6723
@mrbadshaah6723 Жыл бұрын
​@@BM-we4iji am also getting error what should do?
@dassomnath-nnn
@dassomnath-nnn 2 жыл бұрын
17:29 /* Allow user to enter two strings and then concatenate them by saying that str1 is a friend of str2 */ #include #include int main() { char str1[100]; char str2[100]; char str3[]=" is a friend of "; printf("Enter the name: "); gets(str1); printf("Enter the name: "); gets(str2); puts(strcat(str1,strcat(str3,str2))); return 0; }
@mrhuntsman5623
@mrhuntsman5623 11 ай бұрын
Sir Answer to this question is very simple beause of your lectuures: #include #include int main() { char s1[20]; char s2[20]; printf("Enter name of 1st person: "); gets(s1); printf("Enter name of 2nd person: "); gets(s2); char s3[]=" is a friend of "; printf("%s",strcat(s1,strcat(s3,s2))); return 0; }
@adityarajsingh842
@adityarajsingh842 2 жыл бұрын
//Input two strings and concatenate them #include #include void main() { char str1[10], str2[10]; char str3[]=" is a friend of ", str4[10]; printf("Enter the first name: "); gets(str1); printf("Now,enter the second name: "); gets(str2); strcpy(str4,(strcat(str1,str3))); puts(strcat(str4,str2)); }
@adityasaxena6971
@adityasaxena6971 2 жыл бұрын
quiz done sir #include #include int main() { char s1[30]; char s2[30]; char s3[30]=" is a friend of "; printf("Enter the first name "); scanf("%s",s1); printf("Enter the second name "); scanf("%s",s2); puts(strcat(strcat(s1,s3),s2)); return 0; }
@RDSinghofficial
@RDSinghofficial 5 жыл бұрын
#include #include #include int main() { char s1[20]; char s2[20]; char s3[20]; printf("Enter your name"); scanf("%s",&s1); strcat(s1," is a friend of "); printf("Enter Seconds name"); scanf("%s",s2); strcpy(s3,strcat(s1,s2)); puts(s3); }
@syeadtalal114
@syeadtalal114 3 жыл бұрын
How did you solved it?? plz tell me
@MrFab-xu9fj
@MrFab-xu9fj 3 жыл бұрын
Your program is use less
@Amit-kc4hv
@Amit-kc4hv 3 жыл бұрын
@@syeadtalal114 just watch video again and again brother
@aayushchaulagain5324
@aayushchaulagain5324 3 жыл бұрын
where is return 0;
@lokeshsingh8833
@lokeshsingh8833 2 жыл бұрын
bro second name ko s2 me store krwane ke liye & lgao scanf me..
@subhankarkanrar9494
@subhankarkanrar9494 Жыл бұрын
Love 🥰 you harry bhai from bengal. Here is my code. // allow user to enter two strings and then concatenate them by saying that //str1 is a friend of str2 #include #include int main() { char s1[25]; char s2[30]; printf("Please enter two strings: "); gets(s1); gets(s2); printf("%s is a friend of %s ",s1,s2); puts(strcat(s1,s2)); return 0; }
@parthlimbasiya5866
@parthlimbasiya5866 4 жыл бұрын
Awesome.... The Code : #include #include int main() { char s1[50]; char s2[50]; char s3[] = "is friend of"; printf("Enter the two string names : "); gets(s1); gets(s2); printf("%s is friend of %s ", s1, s2); puts(strcat(s1, strcat(s1, s2))); return 0; }
@RAJNISHKUMAR-lf9vh
@RAJNISHKUMAR-lf9vh 3 жыл бұрын
Remove s from string in 2nd line if ur compiler is giving error
@KrishnaVerma-tg6vg
@KrishnaVerma-tg6vg 3 жыл бұрын
In puts you use s3 in change of s1
@MittalAhir-iw2dw
@MittalAhir-iw2dw 4 жыл бұрын
Tysm sir with great explanation
@shivabansal2188
@shivabansal2188 3 жыл бұрын
😘❤️
@ajitgautam5803
@ajitgautam5803 Жыл бұрын
Thank you so much c programing ke bare me btane ke liye
@user-gi8lt3tc8n
@user-gi8lt3tc8n 4 жыл бұрын
What an amazing explanation
@sakalagamingyt3563
@sakalagamingyt3563 2 жыл бұрын
/* author : Bishal jaiswal purpose : practice Quiz from : CodeWithHarry - Harry a great teacher */ #include #include // module needed for this operation int main() { char first[20]; // variable to store the name of the first friend char second[20]; // variable for storing the name of the second friend char var[] = " is a friend of "; // putting a string manually // --------- Operation Specific Variables --------- char string[50]; char finalText[60]; printf("Enter a name > "); gets(first); // taking the name of first friend printf("Enter the another name > "); gets(second); // taking the name of second friend strcpy(string, (strcat(first, var))); /* concatinating the first friend with variable named "var" and storing it in a variable named "string" */ strcpy(finalText, (strcat(string, second))); /* concatinating variable named "string" and "secod" and storing it in a variable named "finalText" */ puts(finalText); // displaying the result return 0; }
@abhishekojha4540
@abhishekojha4540 2 жыл бұрын
// Quick quiz #include #include int main() { char first[20]; char second[20]; printf("Enter first friend name "); gets(first); printf(" "); printf("Enter second friend name "); gets(second); printf(" "); printf("%s is a friend of %s ",first,second); strcat(first,second); printf("This is the concatenated output: \b %s",first,second); return 0; }
@imPriyansh77
@imPriyansh77 Жыл бұрын
#include int main() { char str1[10]; char str2[10]; printf("Enter first name: "); gets(str1); printf("Enter second name: "); gets(str2); printf("%s is a friend of %s", str1, str2); return 0; }
@opdrags8636
@opdrags8636 3 жыл бұрын
C sikhke rhunga 🔥🔥🔥🔥🔥
@blockchaindaily2348
@blockchaindaily2348 3 жыл бұрын
I watch whole advertisement in video.... Love u harry bhau
@chiteez_____1562
@chiteez_____1562 Жыл бұрын
Very nice explanation ! ♥♥😊😊👍👍
@djsam5157
@djsam5157 Жыл бұрын
nice harry vai
@princehacks4807
@princehacks4807 4 жыл бұрын
hi sir i am from Pakistan and your are doing superb job beast of luck sir
@CodeSprint001
@CodeSprint001 Жыл бұрын
Answer of quiz #include #include void main() { char st1[10],st2[10]; char s[50]; char st[]=" is friend of "; printf("enter name of friends"); gets(st1); gets(st2); strcpy(s,strcat(st1,st)); strcat(s,st2); printf("required sentence is: "); puts(s); getchar(); }
@saitamalightyagami7676
@saitamalightyagami7676 2 жыл бұрын
oops did it by mistake #include #include int main() { char s1[20],s2[20],s3[]=" is a friend of "; printf("Enter the name of your friend 1="); gets(s1); printf("Enter the name of your friend 2="); gets(s2); printf(" by easy method "); printf("%s is a friend of %s ",s1,s2); printf("by cat method "); printf("%s",strcat(strcat(s1,s3),s2)); return 0; }
@royfamily9273
@royfamily9273 3 жыл бұрын
Thanks Harry Bhaiya
@code1589
@code1589 5 жыл бұрын
Bhaiya aapke vedio bahut hi ache aur conceptual hote hai lekin koi like nai karta hai .i feel bad when somone is making so much of effort to teach
@HSTech-tp4vi
@HSTech-tp4vi Жыл бұрын
#include #include int main() { char str1[100]; char str2[100]; printf("Enter the first string: "); scanf("%s", str1); printf("Enter the second string: "); scanf("%s", str2); // Concatenate the strings with the desired sentence strcat(str1, " is a friend of "); strcat(str1, str2); printf("Concatenated string: %s ", str1); return 0; }
@namanjain6502
@namanjain6502 2 жыл бұрын
// Online C compiler to run C program online #include #include int main() { char s1[20],s2[20]; printf("enter the input to string s1 : "); gets(s1); printf(" enter the input to string s2 : "); gets(s2); printf(" your enter strings are as below :"); puts(s1); printf(" "); puts(s2); printf(" the output is : "); puts(s1); printf(" is friend of "); puts(s2); return 0; }
@omkoli3077
@omkoli3077 3 жыл бұрын
Thanks Bro withe greatest example
@Ashish...114
@Ashish...114 Жыл бұрын
#Quick Quiz: solution: #include #include int main() { char str1[10]; char str2[10]; char str3[10]; // printf("Concatinating the name of two friends!"); printf("Please type you name: "); gets(str1); puts(str1); printf("Please type your friend's name:) "); gets(str2); printf("%s Is a friend of %s", str1, str2); // strcpy(str3, strcat(str1, str2)); // puts(str3); return 0; }
@ali_thegamer981
@ali_thegamer981 8 ай бұрын
it is an alternative and easy method to run this program without using strcat function:) #include #include #include int main() {char a1[50]; char a2[50]; printf("enter the name of 1st friend: "); gets(a1); printf("enter the name of 2nd friend: "); gets(a2); printf("%s is friend of %s",a1,a2); getch(); }
@shubhamjaiswal2322
@shubhamjaiswal2322 5 жыл бұрын
Harry bhai thanks for the video piche k videos dekh nahi paya abhi or abhi ho nahi paa raha hai time ki kami ho jaa rhi hai notes bhi nahi bana pa raha pointer k baad, I will try to go through all the remaining videos and will try to solve all the further exercise problem, ab tak k sare solve kare hai keep it up thank you
@3_abdullah987
@3_abdullah987 2 жыл бұрын
#include #include int main() { char s1[20] ; char s2[20] ; char s3[54]; printf("Enter the name of first person: "); gets(s1); printf("Enter the name of Seconed person: "); gets(s2); printf("Enter the relation with person: "); gets(s3); printf("%s is a %s of %s", s1, s3,s2); }
@Greninja_1___
@Greninja_1___ Жыл бұрын
when we take string by user then null character will be count . why? #include #include int main() { char name[100] ; printf("enter your string for length counting "); fgets(name,100,stdin); // in this code null character are count in length of code int m= strlen(name); printf("%d",m); return 0; }
@rahul_singh_92
@rahul_singh_92 5 жыл бұрын
Hello brother... Plss make a video on ahMyth full setup
@mayankmaurya3521
@mayankmaurya3521 4 жыл бұрын
#include #include int main() { char f1[32]; char f2[31]; char f3[]=" is friend of "; char f4[50]; printf("First friend "); gets(f1); printf("Second friend "); gets(f2); strcpy(f4,(strcat(f1,(strcat(f3,f2))))); puts(f4); }
@ashutoshjaiswal3543
@ashutoshjaiswal3543 2 жыл бұрын
good one bhai
@shefalichopra6440
@shefalichopra6440 2 жыл бұрын
Can you explain the purpose of F4 here ?
@Dinesh-ig3qo
@Dinesh-ig3qo 2 жыл бұрын
@@shefalichopra6440 he tried to copy all strings into one string so he used f4
@for12th81
@for12th81 Жыл бұрын
The code for the quick quiz is:- #include #include int main(int argc, char const *argv[]) { char str1[20]; char str2[] = "is a freind of "; char str3[20]; gets(str1); gets(str3); strcat(str1, str2); printf("%s", strcat(str1, str3)); return 0; }
@abhisheksaraswat6753
@abhisheksaraswat6753 5 жыл бұрын
Hi Harry bhyi, Please upload videos on python Web Scrapping, and let me know that what is the use of C programming now days?
@AbdulRahman-er3dz
@AbdulRahman-er3dz 4 жыл бұрын
C is used for programming embedded systems
@meerachaudhary238
@meerachaudhary238 3 жыл бұрын
Embedded is totally based on c
@Piyush_Sharma--
@Piyush_Sharma-- Жыл бұрын
this topic is simple no need to remember bro..
@balakp918
@balakp918 4 жыл бұрын
#include #include int main() { char s1[22]; char s2[22]; char s3[22]; printf("Enter first Name "); gets(s1 ); printf("Enter second Name "); gets(s2 ); printf("relation "); gets(s3 ); puts(strcat(s1,strcat(s3,s2))); return 0; }
@friendlycreeper1045
@friendlycreeper1045 4 жыл бұрын
How do you change two values by writing one time? And how do you change all the occurrences of a variable while editing a function snippet?
@professorpoke
@professorpoke 3 жыл бұрын
Thats multi cursor.
@tarunratre7509
@tarunratre7509 5 жыл бұрын
harry bhai electron.js ka bhi series banao. Please...
@pro12378
@pro12378 7 ай бұрын
What's the use of putting char s3[54]; Is it necessary? why do we put it? 14:18
@prapti2385
@prapti2385 Жыл бұрын
#include #include int main() { char str1[50]; char str2[50]; char str3[] = " is a friend of "; printf("Enter your first friend name : "); gets(str1); printf("Enter your second friend name : "); gets(str2); puts(strcat(str1, strcat(str3, str2))); return 0; } Great Lectures Sir, loving them!
@nitinkantikar2203
@nitinkantikar2203 Жыл бұрын
Thx sir ❤️
@ArmaanKhan-xs3ub
@ArmaanKhan-xs3ub Жыл бұрын
#include #include char str1[] = "harry"; char str1[] = "ravi"; char str1[] = "yash"; puts(strcat(s1,s2,s3)); And this syntax are used for strcat function for three friends
@nownow1025
@nownow1025 Жыл бұрын
No
@bhupendradwivedii
@bhupendradwivedii 6 ай бұрын
What is the use of puts() functions in string?????? As like gets() functions is use to took input from user. as like scanf
@Tejas_710
@Tejas_710 Жыл бұрын
//Quiz Time #include #include void main() { char a1[10]; char a2[10]; char a3[]= " is a friend of "; gets(a1); gets(a2); puts(strcat(a1, (strcat(a3, a2)))); printf(" "); } //🤩🤩
@harshrank-zn4cx
@harshrank-zn4cx Жыл бұрын
one thing i dont understand is here why we use both and ? we can use indivisual ?
@safderrehman8563
@safderrehman8563 5 жыл бұрын
#include #include void main(){ char a1[100]; char a2[100]; char a3[80]; printf("Enter Your Name "); gets(a1); printf("Enter Your Friend Name "); gets(a2); strcpy(a3, strcat(strcat(a1 ," is a friend of "), a2)); puts(a3); }
@nishatmunshi4672
@nishatmunshi4672 2 жыл бұрын
answer of quiz: #include #include int main() { char s1[10], s2[10]; char s3[]=" is a friend of "; printf("Enter the name of the first friend: "); gets(s1); printf("Enter the name of the second friend: "); gets(s2); strcpy(s3, strcat (s1, s3)); strcpy(s3, strcat (s3, s2)); puts(s3); return 0; }
@Vaishalichadhari7512
@Vaishalichadhari7512 4 жыл бұрын
//solved #include #include int main() { char f1[40]; char f2[40]; char f3[80]; char line[29]="is friend of"; printf("Enter 1st friend name: "); gets(f1); printf("Enter 2nd friend name: "); gets(f2); strcpy(f3,strcat(f1 ,line)); puts(strcat(f3, f2)); return 0; }
@VibesPop-editz
@VibesPop-editz 2 жыл бұрын
/ quick quiz // allow user to enter two strings and then concatinate them by saying that str 1 is a friend of str 2 #include #include int main() { char s1[10]; // intialize two strings char s2[10]; printf("what's your name ? : "); // print the question gets(s1);// get the input printf("and what's her name ? : "); // another question gets(s2); // get the answer printf("you know %s are too far away from each other " , strcat(s1 , s2)); printf("%s is best friend of %s . that's it . byee" , s2 , s1); // without using strcat() return 0; } output: what's your name? palak what's her name? sakshi you know palaksakshi are too far away form each other or sakshi is best friend of palak. that's it. byee
@MdDanish-zz3zh
@MdDanish-zz3zh 3 жыл бұрын
Thanks sir 😄
@ForUforever123
@ForUforever123 7 ай бұрын
#include #include int main() { char n1[40],n2[50]; printf("ENTER TWO NAMES : "); gets(n1); gets(n2); printf("THE CATENATED NAMES ARE %s",strcat(n1,n2)); return 0; }
@vaishnavisharma4137
@vaishnavisharma4137 4 жыл бұрын
thank you bhaiya very much
@md_arshaq_
@md_arshaq_ 5 ай бұрын
#include #include int main() { char str1[100]; char str2[20]; char str3[30] = " is a frind of "; char str4[50]; printf("Enter the string1= "); scanf("%s",str1); printf("Enter the string2= "); scanf("%s",str2); strcat(str3,str2); strcat(str1,str3); printf("%s",str1); }
@HarshKumar-zm1jl
@HarshKumar-zm1jl 3 жыл бұрын
Thankuu
@NitinKumar-qk1fi
@NitinKumar-qk1fi 4 жыл бұрын
Awesome
@bhuvandahal421
@bhuvandahal421 2 жыл бұрын
//program to find reverse of any string #include #include int main() { char word[20]; printf("enter a word: "); gets(word); int a = strlen(word); printf("the reverse of the word is: "); for(int i=0;i
@Atulsing07
@Atulsing07 2 жыл бұрын
// taking two name and then concatening s1 is a friend of s2 #include #include void main() { char s1[20]; char s2[34]; char s3[]=" is a friend of "; char s4[45]; printf("enter your name : "); gets(s1); printf("enter your friend's name : "); gets(s2); strcpy(s4,strcat(s2,s3)); puts(strcat(s4,s1)); }
@SumitSingh-xu4qs
@SumitSingh-xu4qs 4 жыл бұрын
thanks
@a_61_mohitkumar23
@a_61_mohitkumar23 4 жыл бұрын
printf("mission accomplished and what an amazing class" );
@ronakmaniya2005
@ronakmaniya2005 6 ай бұрын
#include #include int main(){ char name1[10], name2[10]; char str[50]; printf("Enter the name of person1: "); gets(name1); printf("Enter the name of person2: "); gets(name2); strcat(name1," is a friend of "); strcpy(str, strcat(name1, name2)); puts(str); return 0; } output: Enter the name of person1: Ronak Enter the name of person2: Shubham Ronak is a friend of Shubham
@codewithharryfanchannel559
@codewithharryfanchannel559 5 жыл бұрын
Nice
@YouKnowWho288
@YouKnowWho288 2 жыл бұрын
#include int main() { char s1[45], s2[45]; gets(s1); gets(s2); char s3[] = " is a frend of "; puts(strcat(s1 ,strcat(s3, s2))); return 0; }
@Gamertyro
@Gamertyro 2 жыл бұрын
#include #include int main(){ char str1[40]; char str2[40]; char str3[40]="NULL"; printf("Enter s1: "); gets(str1); printf("Enter s2: "); gets(str2); printf("%s is a friend of %s: ",str1,str2); printf(strcat(str1,str3)); return 0; }
@bhuvanbiju9203
@bhuvanbiju9203 2 жыл бұрын
You teach better than my teacher no offence to her
@thinkdaily5140
@thinkdaily5140 4 жыл бұрын
Well done bro🖤👍
@darshnimanekar7111
@darshnimanekar7111 2 жыл бұрын
@ Sir want to know about "strlen" jb string user se lete hai to us strjng ki length me null character count krk output kyu show hota hai...?? Exact string length show q nhi krta..?
@hritavsinghsolanki8893
@hritavsinghsolanki8893 3 жыл бұрын
strrev() is no longer available in gcc linux please stay updated
@alkgupta7015
@alkgupta7015 Жыл бұрын
But I just used it using gcc compiler and it runs with correct output
@priti3448
@priti3448 11 ай бұрын
​@@alkgupta7015if I use puts(strcat(s1,s2)); strcpy(s3,strcat(s1,s2)); printf("%s",s3); Then why the output is Harryravi Harryraviravi Why Harryraviravi is coming ?? Can u please tell this ???
@ak_abhishek9
@ak_abhishek9 11 ай бұрын
yes strrev is not working in my system
@heroassociation6998
@heroassociation6998 7 ай бұрын
Bro, have some brain 🧠. This video is 5 yrs old. Things got upgraded now....
@heeru379
@heeru379 4 жыл бұрын
Sir mere compiler me strrev() work nhi kar rha.
@souviksaha435
@souviksaha435 3 жыл бұрын
Same bro
@ravineemkarolijoshinainital
@ravineemkarolijoshinainital 3 жыл бұрын
It is removed. But we can make this function ourselves.
@prasannakotkar9221
@prasannakotkar9221 3 жыл бұрын
great
@songsexpress1182
@songsexpress1182 5 жыл бұрын
char type array having "harry"..its a string type data that u give "harry"....i mean how can a char type array can get set of data kindly answer me
@victorb22622
@victorb22622 9 ай бұрын
16:21 बेहतर होता , इसका रियल में क्या इस्तेमाल है वो बताते ।क्यू की कंपैरिजन तो फर्स्ट कैरेक्टर का हुआ ,rest of the string character का क्या मतलब
@Prit_Tech_999
@Prit_Tech_999 Жыл бұрын
challenge accepted here the code : #include #include int main(){ printf("put the name of s1 and s2 under 20 characters "); char s1 [20] ; char s2 [20] ; char s3 [] = " is friend of " ; printf("name the s1 "); gets(s1); printf("name the s2 "); gets(s2); puts(strcat(s1,(strcat(s3 ,s2)))); return 0; } runs properly
@sherAli9423
@sherAli9423 Жыл бұрын
Any other functions like strncpy(), strncat(),strcmpi(),strupr(),strlwr(),strchar(),strstr(). Any details??
@AliHussain-sj7cb
@AliHussain-sj7cb 5 жыл бұрын
#include #include int main() { char f1[32]; char f2[32]; char f3[] = " is the friend of "; printf("Enter the first friend's name. "); gets(f1); printf("Enter the second friend's name. "); gets(f2); printf(strcat(f1,strcat(f3,f2))); return 0; }
@legendarychest1630
@legendarychest1630 5 жыл бұрын
Well done dude I also refer your code..for strcat
@digilifeindia8557
@digilifeindia8557 5 жыл бұрын
perfect bro
@mohammadjunedmjb8625
@mohammadjunedmjb8625 4 жыл бұрын
Bro last printf function me strcat ka use ni kiya aaapne printf ko kese pata chalega ki s1 s2 s3 ko combine krna h???? Correct kro
@AliHussain-sj7cb
@AliHussain-sj7cb 4 жыл бұрын
@@mohammadjunedmjb8625 i have used yaar see again
@AliHussain-sj7cb
@AliHussain-sj7cb 4 жыл бұрын
I can use but I concatenated it so I have whole string
@Pocketfmwithharsh
@Pocketfmwithharsh 2 жыл бұрын
Write a program in C to separate the individual characters from a string
@vikassharma2094
@vikassharma2094 4 жыл бұрын
in strcmp() in the first sold only 4 alphabets are there and for tight 5 alphabets so for the fifth alphabet what will be the difference in ASCII ??
@mohitverma5600
@mohitverma5600 3 жыл бұрын
It shows diff of first alphabets of both strings only
@mohammedilyazkhan5425
@mohammedilyazkhan5425 3 жыл бұрын
Challenge accepted bro👍
@rootom2144
@rootom2144 4 жыл бұрын
#include #include int main() { char s1[20]; char s2[20]; char s3[] = " is the friend of"; printf("Enter two friends name "); scanf("%s%s", &s1, &s2); printf("%s %s", strcat(s1, s3), s2); return 0; }
@radha_preymi
@radha_preymi 3 жыл бұрын
Great video 👍👌
@raviraj_shinde_96k
@raviraj_shinde_96k 2 жыл бұрын
#include #include int main() { char f1 [20]; char f2 [20]; // Very important to size of character printf("Please enter two names: 01. "); gets(f1); printf(" \t\t\t02. "); gets(f2); printf(" %s is friend of %s ", f1,f2); printf("Now this word are combined : "); puts(strcat(f1,f2)); return 0; }
@yogeshbhandari7912
@yogeshbhandari7912 2 жыл бұрын
#include #include int main() { char str1[100]; char str2[100]; gets(str1); gets(str2); printf("str1 is a friend of str2 : "); puts(strcat(str1,str2)); }
@lakshaygupta4985
@lakshaygupta4985 Жыл бұрын
#include #include int main() { char s1[50]; char s2[50]; char s3[20]=" is the friend of "; printf("Enter the strings : "); gets(s1); gets(s2); strcat(s1,s3); puts(strcat(s1,s2)); return 0; }
@prashantmehta2832
@prashantmehta2832 4 жыл бұрын
#include #include int main() { char sd; char s1[] = "Prashant "; char s2[] = "is the "; char s3[] = "genius"; char s4[20]; char s5[30]; strcpy(s4, strcat(s1, s2)); strcpy(s5, strcat(s4, s3)); puts(s5); return 0; }
@subhakshankarmakar636
@subhakshankarmakar636 2 жыл бұрын
Hello sir, I have a question. How can we use "%d" in the char function without using "%c" or "%s"?
@gamerznetic
@gamerznetic 2 жыл бұрын
%d is used to return integer value so the answer of your question is for strlen function %d is used as it will return the length which will be obviously a integer value and also for strcpy function it will return the difference of ASCII value....Hope you understand
@RanveerSingh-ph1en
@RanveerSingh-ph1en 2 жыл бұрын
@@gamerznetic great buddy❤️
@Dinesh-ig3qo
@Dinesh-ig3qo 2 жыл бұрын
@@gamerznetic #include #include int main() { char s1[10]; char s4[50]; char s2[30]; char s3[40] = " is a friend of ": gets (s1); gets (s2); strcpy(s4, strcat(s1, s3)); printf("%d ",strlen(s1)); printf(%s ", strcat(s4, s2)); return 0; } Pls help me when I run this code i am getting length of first string as 17/18 huge numbers but I typed first string as 'dd' then length should be 2 but its showing right when I used other strings,what might be reason?? And when strlen line is above strcpy it's giving correct answer
@priti3448
@priti3448 11 ай бұрын
​@@gamerznetic​ if I use puts(strcat(s1,s2)); strcpy(s3,strcat(s1,s2)); printf("%s",s3); Then why the output is Harryravi Harryraviravi Why Harryraviravi is coming ?? Can u please tell this ???
@shayaanrk
@shayaanrk Жыл бұрын
#include #include /*allow the user to enter two string and then * concatenate them by saying * str1 s a friend of str2*/ int main() { char str1[20], str2[]=" is a friend of ", str3[20], str4[50]; printf("Enter the name of first friend: "); gets(str1); printf("Enter the name of second friend: "); gets(str3); ; strcpy(str4, strcat(str1,str2)); printf("%s", strcat(str4, str3)); return 0; }
@shashankpanwar7566
@shashankpanwar7566 2 жыл бұрын
Can you explain string reverse in C
@VISHALSINGH-jk4ly
@VISHALSINGH-jk4ly Жыл бұрын
#include #include int main () { char first[30] , second[30] ,all[30]; char middle[]= " is a friend of "; printf("enter the first name of ur friend : "); gets(first); puts("enter the second name of ur friend : "); gets(second); strcpy(all, ( strcat(first , middle ))); puts(strcat(all, second)); return 0 ; }
@AbhishekSharma-qd2wt
@AbhishekSharma-qd2wt Жыл бұрын
#include #include int main() { char str1[500]; char str2[500]; char str3[]=" is a friend of"; printf("Enter string 1:"); gets(str1); printf("Enter string 2:"); gets(str2); printf("%s %s",strcat(str1,str3),str2); return 0; } Ans of quiz
@deeptailor8612
@deeptailor8612 6 ай бұрын
#include #include int main() { char s1[30]; char s2[30]; char s3[30] = " is a frind of "; // Take first string input from user printf("Enter the name of first friend:"); fgets(s1,50,stdin);// Read input from standard input (keyboard) s1[strcspn(s1, " ")] = 0;// Remove trailing newline character // Take second string input from user printf("Enter the name of second friend:"); fgets(s2,50,stdin);// Read input from standard input (keyboard) s2[strcspn(s2, " ")] = 0;// Remove trailing newline character // Concatenate all strings puts(strcat(s1,(strcat(s3, s2)))); return 0; }
@dum0
@dum0 Жыл бұрын
answer to the quiz : #include int main() { char a[40]; char b[50]; char d[50]; char e[50]; printf("enter the first name : "); gets(a); printf("enter the second name : "); gets(b); char c[30]=" is a friend of "; strcpy(d, strcat(a, c)); strcpy(e, strcat(d, b)); puts(e); return 0; }
@polymorphic4401
@polymorphic4401 2 жыл бұрын
#include #include int main() { char string[100]; printf("Check string is palindrom or not : "); scanf("%s", string); char newstring[100]; strcpy(newstring, string); char *revstr = strrev(string); if (strcmp(revstr, newstring) == 0) { printf("String is palindrom"); } else { printf("String is not palindrom"); } return 0; }
@saikat2649
@saikat2649 2 жыл бұрын
#include #include int main() { char str1[20], str2[20]; gets(str1); gets(str2); char str3[]=" is a good friend of "; char k[20]; strcpy(k,strcat(str1,str3)); puts(strcat(k,str2)); return 0; }
@chirayumittal8099
@chirayumittal8099 3 жыл бұрын
Hey so in my laptop it is showing trace trap when I use strcat code any solution for it
@RAJNISHKUMAR-lf9vh
@RAJNISHKUMAR-lf9vh 3 жыл бұрын
Your laptop is kharab Do jump on it I
@ravineemkarolijoshinainital
@ravineemkarolijoshinainital 3 жыл бұрын
@@RAJNISHKUMAR-lf9vh Kuch bhi?
@RK-bz9ps
@RK-bz9ps Жыл бұрын
hello Harry bhaiyya bhaiyya isme online compiler me strrev() se error show ho raha hai
@PratyooshPrakash
@PratyooshPrakash 7 ай бұрын
If you are having problems with strrev not working anymore, here's the code for the function: void strreverse(char string[]) { int k = strlen(string); for (int i = k-1; i >= 0; i--) { printf("%c", string[i]); } printf(" "); } I wasn't able to use strrev, as it is still somewhere in the file so we can't use this name in a function.
@deepakgoswamivlog7584
@deepakgoswamivlog7584 Жыл бұрын
challange accepted 1. #include #include // string library int main() { char s1[] = "harry is a friend of "; char s2[] = "ravi"; puts(strcat(s1, s2)); return 0; } harry is a friend of ravi 2. #include #include // string library int main() { char s1[] = "harry is a friend of "; char s3[] = "ravi"; puts(strcat(s1, s3)); return 0; }
@kundanmane9665
@kundanmane9665 3 жыл бұрын
Hello sir can you tell me while running the code why it is showing that implicit declaration of fun
@Anupma-zf7tt
@Anupma-zf7tt 3 жыл бұрын
pliz turn off real time scan of ur antivirus.
Array Reversal In C - Exercise 5: C Tutorial In Hindi #36
3:41
CodeWithHarry
Рет қаралды 129 М.
Strings In C: C Tutorial In Hindi #34
21:37
CodeWithHarry
Рет қаралды 426 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Web Developer Roadmap (2025) - Everything is Changing
21:48
CodeWithHarry
Рет қаралды 367 М.
Learning C# In A Week... Otherwise I Fail University
9:04
Structures In C: C Tutorial In Hindi #37
26:18
CodeWithHarry
Рет қаралды 518 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 342 М.
How to REALLY learn C++
8:13
The Cherno
Рет қаралды 816 М.
Call by Value & Call By Reference In C: C Tutorial In Hindi #31
27:30
CodeWithHarry
Рет қаралды 381 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН