C Program to Reverse a String

preview_player
Показать описание
Program to reverse a string without using strrev in C Language

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

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

CodeWithHarry
Автор

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 💕

Jaii_shree_Ram
Автор

Dear Sir, please make a Java playlist like C++ and Pythons so that we can learn Java easily 🙏🙏🙏🙏🙏🙏

aseries
Автор

Sir may Pakistan si ho may 14 sal ka ho may ni apki channel si programing lunguge seek li hian
Love you 👍👍❤️❤️❤️

kokangreen
Автор

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

vampkaitsolution
Автор

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.

parthaschakra
Автор

How to deal with mistakes!
You helped in rectifying my mistake and improve it

harshitachaurasia
Автор

Please Make a Motivational video i, m watching your javascript playlist i have no computer i, m learning from my phone

aamirbhat
Автор

Thank you so much Harry Bhai. Excellent work.

engineerbhai
Автор

Bhai you are awesome thankyou so much for helping us ♥️❤️...I am your biggest fan 🔥

technicalknowledge
Автор

Sir i think there is a mistake in the program.
in the for loop i<len/2 will be there
ps-In the above example demonstrated, "Harry" r repeats 2 times thats why it is showing correct answer.
But if we try by any any reppitative alphabets in the middle(for e.g. sourav) this will give wrong result(vauros).

souravchatterjee
Автор

bhaiya aap bohut jyaada achhe se explain kr rahe hae ....plz possible ho to isme or bhi achhe questions add kijiega :)

sakshinaruka
Автор

@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.

dakshkalucha
Автор

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<=(len-1)/2 " then only we can get reverse of string in right order.

i know the logic is right, its just a minor mistake..worry not.

suyashsingh
Автор

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

void main()
{
char array[250];
scanf("%s", array);
char rev[250];
strcpy(rev, strrev(array));
printf("%s", rev);
}

manoor
Автор

Thankyou Harry. Will you include the advanced/ latest features of c language as you keep on with these tutorials ??

anilsundar
Автор

Bhaiya I'm in class 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

sidhaantagarwal
Автор

Reversing a String :

#include <stdio.h>
#include <string.h>
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;
}

printfiamd
Автор

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 <= (len - 1)/2, it works correctly. Please help to clarify this doubt.

akshaykothari
Автор

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

Yu-music-bj