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; }
@jatintomar81707 ай бұрын
// 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 Жыл бұрын
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
@supzzz047 ай бұрын
you are exactly right .I was also struggling with apna college video but Sir 's videos are amazing easy to understand and remember
@arkabhattacharya33793 жыл бұрын
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.
@thesmartone66012 жыл бұрын
Bro I am not getting your code for how %/n and %*c is used? Can you please explain your code more clearly?
@BM-we4ij2 жыл бұрын
Hi, do u mean to say, we cannot not use (strrev) to reverse now?? Bcz I am getting error....
@N-methyl1phenylpropan-2-amine2 жыл бұрын
Or you could just use fgets()
@chirntn Жыл бұрын
rather , use fgets char s1[10]; fgets(s1, size0f(s1),stdin);
@mrbadshaah6723 Жыл бұрын
@@BM-we4iji am also getting error what should do?
@dassomnath-nnn2 жыл бұрын
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; }
@mrhuntsman562311 ай бұрын
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; }
@adityarajsingh8422 жыл бұрын
//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)); }
@adityasaxena69712 жыл бұрын
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; }
@RDSinghofficial5 жыл бұрын
#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); }
@syeadtalal1143 жыл бұрын
How did you solved it?? plz tell me
@MrFab-xu9fj3 жыл бұрын
Your program is use less
@Amit-kc4hv3 жыл бұрын
@@syeadtalal114 just watch video again and again brother
@aayushchaulagain53243 жыл бұрын
where is return 0;
@lokeshsingh88332 жыл бұрын
bro second name ko s2 me store krwane ke liye & lgao scanf me..
@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; }
@parthlimbasiya58664 жыл бұрын
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-lf9vh3 жыл бұрын
Remove s from string in 2nd line if ur compiler is giving error
@KrishnaVerma-tg6vg3 жыл бұрын
In puts you use s3 in change of s1
@MittalAhir-iw2dw4 жыл бұрын
Tysm sir with great explanation
@shivabansal21883 жыл бұрын
😘❤️
@ajitgautam5803 Жыл бұрын
Thank you so much c programing ke bare me btane ke liye
@user-gi8lt3tc8n4 жыл бұрын
What an amazing explanation
@sakalagamingyt35632 жыл бұрын
/* 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; }
@abhishekojha45402 жыл бұрын
// 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 Жыл бұрын
#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; }
@opdrags86363 жыл бұрын
C sikhke rhunga 🔥🔥🔥🔥🔥
@blockchaindaily23483 жыл бұрын
I watch whole advertisement in video.... Love u harry bhau
@chiteez_____1562 Жыл бұрын
Very nice explanation ! ♥♥😊😊👍👍
@djsam5157 Жыл бұрын
nice harry vai
@princehacks48074 жыл бұрын
hi sir i am from Pakistan and your are doing superb job beast of luck sir
@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(); }
@saitamalightyagami76762 жыл бұрын
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; }
@royfamily92733 жыл бұрын
Thanks Harry Bhaiya
@code15895 жыл бұрын
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 Жыл бұрын
#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; }
@namanjain65022 жыл бұрын
// 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; }
@omkoli30773 жыл бұрын
Thanks Bro withe greatest example
@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_thegamer9818 ай бұрын
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(); }
@shubhamjaiswal23225 жыл бұрын
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_abdullah9872 жыл бұрын
#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___ Жыл бұрын
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_925 жыл бұрын
Hello brother... Plss make a video on ahMyth full setup
@mayankmaurya35214 жыл бұрын
#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); }
@ashutoshjaiswal35432 жыл бұрын
good one bhai
@shefalichopra64402 жыл бұрын
Can you explain the purpose of F4 here ?
@Dinesh-ig3qo2 жыл бұрын
@@shefalichopra6440 he tried to copy all strings into one string so he used f4
@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; }
@abhisheksaraswat67535 жыл бұрын
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-er3dz4 жыл бұрын
C is used for programming embedded systems
@meerachaudhary2383 жыл бұрын
Embedded is totally based on c
@Piyush_Sharma-- Жыл бұрын
this topic is simple no need to remember bro..
@balakp9184 жыл бұрын
#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; }
@friendlycreeper10454 жыл бұрын
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?
@professorpoke3 жыл бұрын
Thats multi cursor.
@tarunratre75095 жыл бұрын
harry bhai electron.js ka bhi series banao. Please...
@pro123787 ай бұрын
What's the use of putting char s3[54]; Is it necessary? why do we put it? 14:18
@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 Жыл бұрын
Thx sir ❤️
@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 Жыл бұрын
No
@bhupendradwivedii6 ай бұрын
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 Жыл бұрын
//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 Жыл бұрын
one thing i dont understand is here why we use both and ? we can use indivisual ?
@safderrehman85635 жыл бұрын
#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); }
@nishatmunshi46722 жыл бұрын
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; }
/ 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-zz3zh3 жыл бұрын
Thanks sir 😄
@ForUforever1237 ай бұрын
#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; }
@vaishnavisharma41374 жыл бұрын
thank you bhaiya very much
@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-zm1jl3 жыл бұрын
Thankuu
@NitinKumar-qk1fi4 жыл бұрын
Awesome
@bhuvandahal4212 жыл бұрын
//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
@Atulsing072 жыл бұрын
// 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-xu4qs4 жыл бұрын
thanks
@a_61_mohitkumar234 жыл бұрын
printf("mission accomplished and what an amazing class" );
@ronakmaniya20056 ай бұрын
#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
@codewithharryfanchannel5595 жыл бұрын
Nice
@YouKnowWho2882 жыл бұрын
#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; }
@Gamertyro2 жыл бұрын
#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; }
@bhuvanbiju92032 жыл бұрын
You teach better than my teacher no offence to her
@thinkdaily51404 жыл бұрын
Well done bro🖤👍
@darshnimanekar71112 жыл бұрын
@ 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..?
@hritavsinghsolanki88933 жыл бұрын
strrev() is no longer available in gcc linux please stay updated
@alkgupta7015 Жыл бұрын
But I just used it using gcc compiler and it runs with correct output
@priti344811 ай бұрын
@@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_abhishek911 ай бұрын
yes strrev is not working in my system
@heroassociation69987 ай бұрын
Bro, have some brain 🧠. This video is 5 yrs old. Things got upgraded now....
@heeru3794 жыл бұрын
Sir mere compiler me strrev() work nhi kar rha.
@souviksaha4353 жыл бұрын
Same bro
@ravineemkarolijoshinainital3 жыл бұрын
It is removed. But we can make this function ourselves.
@prasannakotkar92213 жыл бұрын
great
@songsexpress11825 жыл бұрын
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
@victorb226229 ай бұрын
16:21 बेहतर होता , इसका रियल में क्या इस्तेमाल है वो बताते ।क्यू की कंपैरिजन तो फर्स्ट कैरेक्टर का हुआ ,rest of the string character का क्या मतलब
@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 Жыл бұрын
Any other functions like strncpy(), strncat(),strcmpi(),strupr(),strlwr(),strchar(),strstr(). Any details??
@AliHussain-sj7cb5 жыл бұрын
#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; }
@legendarychest16305 жыл бұрын
Well done dude I also refer your code..for strcat
@digilifeindia85575 жыл бұрын
perfect bro
@mohammadjunedmjb86254 жыл бұрын
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-sj7cb4 жыл бұрын
@@mohammadjunedmjb8625 i have used yaar see again
@AliHussain-sj7cb4 жыл бұрын
I can use but I concatenated it so I have whole string
@Pocketfmwithharsh2 жыл бұрын
Write a program in C to separate the individual characters from a string
@vikassharma20944 жыл бұрын
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 ??
@mohitverma56003 жыл бұрын
It shows diff of first alphabets of both strings only
@mohammedilyazkhan54253 жыл бұрын
Challenge accepted bro👍
@rootom21444 жыл бұрын
#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_preymi3 жыл бұрын
Great video 👍👌
@raviraj_shinde_96k2 жыл бұрын
#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; }
@yogeshbhandari79122 жыл бұрын
#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 Жыл бұрын
#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; }
Hello sir, I have a question. How can we use "%d" in the char function without using "%c" or "%s"?
@gamerznetic2 жыл бұрын
%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-ph1en2 жыл бұрын
@@gamerznetic great buddy❤️
@Dinesh-ig3qo2 жыл бұрын
@@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
@priti344811 ай бұрын
@@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 Жыл бұрын
#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; }
@shashankpanwar75662 жыл бұрын
Can you explain string reverse in C
@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 Жыл бұрын
#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
@deeptailor86126 ай бұрын
#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 Жыл бұрын
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; }
@polymorphic44012 жыл бұрын
#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; }
@saikat26492 жыл бұрын
#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; }
@chirayumittal80993 жыл бұрын
Hey so in my laptop it is showing trace trap when I use strcat code any solution for it
@RAJNISHKUMAR-lf9vh3 жыл бұрын
Your laptop is kharab Do jump on it I
@ravineemkarolijoshinainital3 жыл бұрын
@@RAJNISHKUMAR-lf9vh Kuch bhi?
@RK-bz9ps Жыл бұрын
hello Harry bhaiyya bhaiyya isme online compiler me strrev() se error show ho raha hai
@PratyooshPrakash7 ай бұрын
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 Жыл бұрын
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; }
@kundanmane96653 жыл бұрын
Hello sir can you tell me while running the code why it is showing that implicit declaration of fun