C Program to Reverse a String
Vložit
- čas přidán 27. 08. 2024
- Program to reverse a string without using strrev in C Language
I hope you like this C Practice video. Here is the playlist for similar programs: • C Language Practice Pr...
►Checkout my English channel here: / programmingwithharry
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here
I made a mistake while writing this program but instead of re-recording, I decided to show you the steps I took to correct my mistakes. Frankly speaking the video actually turned out to be great in my opinion! Don't miss this video!
Access this playlist and if you share it on Insta dont forget to tag me
Instagram: instagram.com/CodeWithHarry
It was really great video
Practice makes perfect
it was really nice!
eska aur optimized sol kya hoga??
Sir java playlist please
Raat me sone jao .. codewithharry uploaded new video ...subh utho then we have again notification 💕such hard working man 💝 lots of love and respect Harry bhai .. after this 2020 definitely your channel will have new heights 💕
That's what Harry's doi'n for us
@@mondipeditz8578 Help me?
Where should I learn C 15hrs video of harry or the playlist by harry.
@@mondipeditz8578 Help me?
Where should I learn C 15hrs video of harry or the playlist by harry.
@@anant-strong just learn it from internet
@@mondipeditz8578 internet?
Dear Sir, please make a Java playlist like C++ and Pythons so that we can learn Java easily 🙏🙏🙏🙏🙏🙏
Hey bro.. You were on java and c++ before 2 years..
I'm beginner.. Where are you right now? Can you tell me?
How's your journey?.. I guess if you had learnt java c++ before 2 years
. You are top of a head since now.. Reply plz. 😊
Sir may Pakistan si ho may 14 sal ka ho may ni apki channel si programing lunguge seek li hian
Love you 👍👍❤️❤️❤️
Harry bhi mai aj website development ap sai sikha hu or mai aj khud k web company chala rha hu ap k itna acha sikha nai k waja sai or jb v mujko problem hota hai ap k video sai abi v bahut help hota hai thanks allha ap ko salamat rakhay thanks bhi
It's a good learning exercise. Just wanted to mention about a small glitch.
It wont work properly if the length is an even number (say "Harrys" instead of "Harry").
Need to add a function to check odd/even and run the "i" loop accordingly.
Use memmove() ....both is of order n
Yes, it's not working for even number
How to deal with mistakes!
You helped in rectifying my mistake and improve it
#include
#include
#include
void main()
{
char array[250];
scanf("%s",array);
char rev[250];
strcpy(rev,strrev(array));
printf("%s",rev);
}
Please Make a Motivational video i,m watching your javascript playlist i have no computer i,m learning from my phone
Reversing a String :
#include
#include
int main()
{
char s[100];
printf("Enter a Word : ");
scanf("%s",s);
int l=strlen(s);
for(int i=l-1;i>=0;i--)
{
printf("%c",s[i]);
}
return 0;
}
Yes bro, even I wanted to say that this is the fast and quickest solution instead of that shitt
Thank you so much Harry Bhai. Excellent work.
Bhai you are awesome thankyou so much for helping us ♥️❤️...I am your biggest fan 🔥
Thank you sir ji.
Hello harry bhaiya.....big fan
Thankyou Harry. Will you include the advanced/ latest features of c language as you keep on with these tutorials ??
@CodeWithHarry sir len-1/2 is not working for "even" length of string... it should be len/2 as it gives an integer... this works for both even and odd and also for len = 8 we should go from 0 to 4 not 0 to 3 and hence len/2 is correct... and otherwise len -1-i is also correct.
It will work if you use
bhaiya aap bohut jyaada achhe se explain kr rahe hae ....plz possible ho to isme or bhi achhe questions add kijiega :)
Sir i think there is a mistake in the program.
in the for loop i
YES
EXACTLY!!!
i did len/2
this is working for me
I want this best video and best channel😊😍😘
we dont need to go with (n-1)/2 because compiler always take floor value if its int it will give out put 7/2=3
love you harry bhai
Sir java playlist please
Hi Harry, ek doubt tha iss video mein. I tried to run this code with the string "Akshay" and it resulted in "yashka" but the correct value for reversed string should be "yahskA". But when I change the code in the for loop from i < ( len -1)/2 to i
bhai apne shi kiya he mene bhi try kia👍..
Len/2 krk b work kr rha h
Much Appreciated Bhai!
Nice haary bhai make video on your programming journey
Bhai solid Yaar gjb Maza as gaya bro
It's help me a lot
15:08 this is wrong for even numbers try writing something other than harry (ex- someon)
ya man
Bhaiya I'm in class 11.....and I love coding a lot....pls guide kar dijiye what games I can make in pygame...I have already made space invaders game and fruit ninga type games...plz suggest...flappybird bhi code kar raha hu filal....ho sake bhaiya to aap bhi kuch naye games upload karona
There is Problem in code.
Hello Harry...i love your content and thank you for all vedios, but in this vedio in "for loop we have to write i
you are great.
//using only one array:
#include
#include
#include
void main()
{
char array[300];
char a;
gets(array);
for (int i = 0; i < strlen(array)/2; i++)
{
a=array[i];
array[i]=array[strlen(array)-1-i];
array[strlen(array)-1-i]=a;
}
puts(array);
}
Harry bhai 👋👋
Imagine getting a heart from codewithharry
Excited to get this golden opportunity
Please make a videos series on python for data science...
Hello sir aap mic kon sa use kr rahy hain... Main ny kafi bar comment kia lekin koi reply nhi aaya...
Please make a full tutorial series on kivy
Harry bhai can you solve some questions of Hacker rank and Leetcode........ please
#include
#include
#include
void main()
{
char array[300];
gets(array);
char rev[strlen(array)];
for (int i = 0; i < strlen(array); i++)
{
rev[i]=array[strlen(array)-1-i];
}
puts(rev);
}
sir androrid studio pe koi tutorial banaiye plzz🙏🙏🙏🙏🙏
It's already there 🙄🙄
Awesome video
Harry bhai kotlin ka vdo bana do plzzzz
sir plz make vidoes on kali linux
Sir please start series of html and css
Harry bhy Zindabad 🙏🙏
line 9 main %d ki jaga %s aae ga coz uh are taking srting not an integer
please make playlist on reactjs please you have created playlist of website development but reactjs is included in that so without reactjs its incomlete its necessary for web developer to learn reactjs also so please make reactjs playlist in hindi. i am searching for it so long but can't able to find a good teacher like you to make things easier to understand please please .
from your fan and student.
if we give a string having even number of characters with middle 2 alphabets different the program won't give correct result. for example in word hariys
stack se brackets ka program bhi dikhao, hackerrank ya codechef k questions bhi bataiye
Hello Sir,
I need your Pycharm Settings that you used in your tkinter series (Example, from, import, def keyword statements are in blue foreground)
Pls reply...
len/2 is correct bro.
Loop chalshe half of a string array size 😁
Please tell how to make pong game or easiest game in c
Sir gmail contact form banana sikhye Django me plzz
Sir ,pls aap c++ ke practice problem ke video upload karna .
I had grabbed the mistake that you made (len-2-i)i was like oh yeah soon you're gonna correct it into len-1-i😄😄
Can you help me?
Where should i learn C 15hrs video of harry or the playlist of C.
Playlist
And you can even watch the Naresh i technology
@@vivekgupta_3085 thanks for the answer i have started the playlist
@@anant-strong which playlist Naresh it ?
In for loop we should use len/2 it will work both for even and odd strings.
Great video harry bhai🤍
Thanks, man, for clearing this doubt
Yes! he has only done for odd strings...but len/2 will cover all cases
Sir
Ydi saare different char ho to 3rd wala reverse nhi ho rha h
sir, mere django project me norrmally sirf yahi requirment hai..
1. user detail me user ka mobile no and uska image required hai,
2. user bhi html page se hi apna blog post kar sake
3. user apna detail update or delete kar skae
please sir thora time nikal ke kuch video bana do ess se related hindi me
sorry sir aapko is channel pe msg kiya kyon ki abhi aap isis channel pe active ho..
Harry bhai first viewer
Are you using a pen or something like that or doing this with mouse please answer ???😢
Sir of string pattern. A reverse like name?
Harry how to launch website
mere abhi bhi run nahi ho raha hai me kya karu mere name himanshu hai and me jab string me himanshu type kar raha hu rab mere reverse string " uhsanmih" ye aa raha hai , mene code bhi check kara hai same to same hai?
please solve harry bhai
Sir pls keep the algorithm for this code
First
areey yaar automated script laga rakhi hae kya jo har bhar First 😅️😅️
👍🏻
Bhai pahli baar apke mistakes dekhe maja aa gaya.....bura maat manna...
Harry bro
I m new in your channel I want to ask question that best course for java and android developer plzzzz help me reply
Sir PLease make React Js course React webdevelopment course or any simple introduction how can i become a react js developer
Sir please help
I am beginner in c language and I want to become game programmer so please suggest me which window I use
#include
int main() {
// Write C code here
char str[100]={"Harry"};
int count=0;
while(str[count]!='\0'){
count++;
}
//reversing a string
for(int i=count-1;i>=0;i--){
printf("%c", str[i]);
} return 0;
}
Bhai please reply , c Kaha se sikhu 15 hour se ya playlist se ?
Kyaa ek 4GB ke pc me python hoskti haii
Internal storage ya RAM??
@@Ammarkoka 4GB RAM
@@uniqcreationz obviously bro why not i have also 4gb ram. Python is very light weight you can also use different ide such as vscode and sublime but i give u advise don't use any highweight ide's such as pycharm little bit hanged in system. But you can also use that's also. If you want.
@@Ammarkoka ok thanks 💯🥳
herry vai ye sirf odd le liye likha apnee
this code is for any string:)
#include
int main(){
int i,j;
char arry[100];
printf("enter string: ");
scanf("%s",&arry);
//length of arry
int len=0;
while(arry[len] != '\0' ){
len++;
}
printf("the length of string is %d",len);
int num=0;
if(len%2==0){
num=len/2;
}else{
num=(len-1)/2;
}
for(int i=0;i
Harry bhai Please Yaar Reply To Kr Do Kai Baar Comment Kr Diya
Please Ek video Bana Do Competitive Programing Par Me Python Prefer Karta Lekin Competitive Coding Ke Liye c++ use karna chhahta hoon to kya ek company accept kr skti hai esa banda jo Competitive Coding c++ me kre aur Devlopment python
Aur harry road map please explain kro yaar i am in 2nd year right now
Bro Please🙏❣️
Thanks For Free Education
Sir c++ ke liye cout ka sentence kaise banega
Advance web development course tutorials place
Please tell how to make easiest c game with animation
Who want ❤❤ from harry bhai
Sir how to integrate payment gateway for website in nodejs reactjs steps by step
Sir pls livestream kar do
👍👍
Please Reply
Harry Bhai Aapse ek sawal aap apne aap ko harry kyo bulate ho haris ali khan ke badle
1 st comment like me thank you
Harry bahi I have made projects in python and these are now visible on screen how can I access them again
Sir please help me
I am c beginner and I want to become game programmer so please please please please please help me to find a good window
Sir aap to raftar mi tare bolte ho🤔
bro , your code is wrong , please try string other than harrry
Harry bhai maine reverse JAVA mein try kiya bina kisi method se. Barabar nahi output aa raha hai. Can you please find out the mistake?
import java.util.*;
public class Reverseee
{
public static void main(String[] args)
{
String str="Siddhesh"; //my string
char st[]=new char[10]; //character array to store string
System.out.println(d);
int i,j;
int c=str.length();
for(i=c-1;i>=0;i--)
{
for(j=0;j
WOULD BE THE CORRECT CODE :
import java.util.*;
public class Reverseee {
public static void main(String[] args) {
String str = "Siddhesh"; // my string
char st[] = new char[10]; // character array to store string
int i, j;
int c = str.length();
// Reverse the characters in the string and store them in the character array
for (i = 0, j = c - 1; i < c; i++, j--) {
st[i] = str.charAt(j);
}
// Print the reversed string
System.out.println("Output
");
for (i = 0; i < str.length(); i++) {
System.out.print(st[i]);
}
System.out.println();
}
}
Hello harry bhai "Android ka course in KOTLIN" bana do if possible.
Waise aapka pura naam kya h 😅 mein linkedIn pe search kr raha tha par mila hi nahi
His name is Haris Ali Khan
He is a graduate of IIT Kharagpur
Hello brother...??
bhai bhut badi string ke liye ye fail ho raha hai
first comment 🤗🤗
Advertisement khuch jayda h
Nitish
naa betaa naaa
Inested of Harry just put Hary it doesn't work
bhai please muje pin kardo harry bhai please dil seh
Kuch palle hi nhi pda