C_69 C Program to Reverse a String | with strrev() and without strrev() function
Vložit
- čas přidán 27. 08. 2024
- In this lecture we will discuss a C program to Reverse a string with strrev() and without strrev() function.
Best C Programming Tutorials: • Programming in C
*********************************************
Connect & Contact Me:
Jenny's Lecture Hindi: / @jennyslectureshindi
Facebook: / jennys-lectures-csit-n...
Quora: www.quora.com/...
Instagram: / jayantikhatrilamba
Twitter: / khatrijenny
Telegram Group Link: Jenny's Lectures
telegram.me/je...
*******************************************
More Playlists:
Programming in C Tutorials: • Programming in C
C++ Tutorials for beginners: • Lec 1: How to Install ...
Printing Pattern in C: • Printing Pattern Progr...
Best Python Tutorials for Beginners: • Python - Basic to Advance
Placement Series: • Placements Series
Data Structures and Algorithms: https: • Data Structures and Al...
Design and Analysis of Algorithms(DAA): • Design and Analysis of...
Dynamic Programming: • Dynamic Programming
Operating Systems tutorials: // • Operating Systems
DBMS Tutorials: • DBMS (Database Managem...
Tags:
strings, string in c, what is string, c programming tutorials, c programming, best c programming tutorials
#coding #strings #jennyslectures #cprogramming #clanguage
Literally THE best teacher on CZcams!!!! Thank you so much for such a great explanation!!!!!!
Wonderful lecture. This is exactly the type of explanation I was looking for!!!!!
Wow, this is so powerful. First time seeing your video and I am 100% impressed. Thank you
She knows what all to say, and what all details to include while to make it CRYSTAL CLEAR understanding to beginners. She steps at beginners level herself in order to deliver utmost. Heartfelt THANKS!!!!
I like this amazingly lecturer.
with and with out the predefined functions.
i have watched multiple others but they just show in way not both like this.
you are my favourite keep going.
your way of teaching is awesome 🤩 if possible then plzz 🙏 make play list on html , css and java || it a humble request🙏 ||
Tanx, I have started re-learning c programming being an opsimath bit difficult but u made my day🙌
The way you teach is just awesome 👍
Keep on working.
You are best mam
You are changing your teaching style👍👍
im ict teacher and its great that you teach me and sharing your knowledge
i feel like you in classroom and ask me and get afraid :D and replay the part that i didn't understand it again to answer your question :)
you are really genius !
Thanks ❤️ for this masterpiece heart Fr0m Kashmir (Gulmarg) 😍
Thanks Mam for your great effort and gives us great lecturer.. ❣️
czcams.com/video/RNXLD9jTcQ4/video.html
Thankyou mam. You clear my most of problems.
czcams.com/video/RNXLD9jTcQ4/video.html
Lovely explaination Hats off🎩
czcams.com/video/RNXLD9jTcQ4/video.html
Best playlist for C language
#include
#include
int main(){
char str[30] = "Nikhil";
int len = strlen(str);
int j = len-1;
int i=0;
while(j > i){
char ch = str[i];
str[i] = str[j];
str[j] = ch;
j--;
i++;
}
printf("%s",str);
return 0;
}
#include
#include
#include
void main()
{
char s1[30];
gets (s1);
int l=strlen(s1);
for(int i=l;i>=0;i--)
{
printf("%c",s1[i]);
}
}
#include
#include
#include
void main(){
char str1[50]="India is great",str2[50];
int l=strlen(str1),i,j=0;
printf("Original string=%s
",str1);
for(i=0;i
#inclde
#inclde
#inclde
Main()
{ char s[20];
printf ("
enter a string ") ;
gets(s) ;
strrev(s) ;
printf (the reverse string is%d, s)
}
OUTPUT:
Enter a string
The reverse string is inam
Mani
%d in 2nd printf will give you error!
There will be%s in 2nd printf
*REVERSING OF STRING IS NOT SWAPPING* - strrev() does swapping of characters but if a string can be printed in reverse order then it's also reversing. If the requirement is only for output then reversing a string without swapping is also correct. But why are you doing this with for loop if we can use strrev() for that?
I have written a code to reverse the code without using the string header. Here is the code:
// Program to reverse a string without using string.h header file
#include
int main()
{
char a[31], swap_a;
int i, j, a_size, string_size = 0;
for (i = 0; i < 30; i++)
{
a[i] = 0;
}
printf("Enter a word within 30 characters: ");
scanf("%s", a);
for (i = 0; a[i] != 0; i++)
{
string_size++;
}
for (i = 0, j = string_size; i < string_size/2; i++)
{
swap_a = a[i];
a[i] = a[j-1-i];
a[j-1-i] = swap_a;
}
printf("%s
", a);
return 0;
}
Because some compilers wont see the strrev() function in the library. This way, one can write the function by one’s self and then use it throughout the program.
@@ajayijohnson strrev() is defined in string.h header file and which compilers do you THINK don't SUPPORT this header file?
@@debojitacharjee Yes! I know it’s in that header file string.h but then I’m also aware that it’s mostly available in windows system. I have tried to use this command in a Linux environment and the function strrev() and some other functions are not in the header file string.h. There peculiarities with different environment and in case one cannot find it, the algorithm can be written.
@@ajayijohnson it's the problem with gcc compiler but that means compiling on Windows would make a program more code optimized. Using functions instead of custom code optimizes the overall LOC.
@@debojitacharjee online compilers
Madam please make videos on python plzz
I am a mechanical student but intrest to learn python when see u r way of teaching....
Plzzzzzz plzzzzzzz plzzzzzz plzzzzzzz reply mam...❤️
Playback speed 1.5X😂
No bro 2x and at exam time yh bhi slow lagta h 🙂🙂
@@aashishsingh6857 if you have exam then. why are you reading comments 😂
@@aashishsingh6857 me right now😂
For me, it’s 2x.
@@yogeesh_kulal02 2x
mam aapki wajh se muje programming easy lagni lagi hai
As always miss ! you have a teaching talent , continue please ! god bless you
Mam ! In every video You smile in the beginning and at the end only 😃😃
I like that though ❤️
Respected madam zi,
Helping to strengthen to programme,
I dont know but loved this lecture and my fev topic ever ❤❤
Mam ur teaching is very nice and easy to understand
czcams.com/video/RNXLD9jTcQ4/video.html
isme hm log for loop me agr change kr lete for(I=6;I
Very good explanation.. thanks 😊
👍 Very helpful video Mam.
czcams.com/video/RNXLD9jTcQ4/video.html
Your angel eyes are increasing my understanding
Best Explanation.. ever .🎉
New viewer of your channel mam..
czcams.com/video/RNXLD9jTcQ4/video.html
Thank you so much ma'am ❤️
Whenever you star UDF please explain it with some easy way because I was learned that before 5 time but steal confusing... 😵
Superb explained mam...
#include
#include
int main() {
int len1;
char s1[1000];
printf("Enter your string : ");
fgets(s1,100,stdin);
len1 = strlen(s1);
for(int i = len1; i>=0; i--) {
printf("%c", s1[i]);
} printf("
");
return 0;
}
Best of tha best teacher 😘😘
czcams.com/video/RNXLD9jTcQ4/video.html
mam in how many days this course will be complete (estimated time)??
so awesome teaching really to much interested teaching way
Greatly explain ma'am.......
such a great explanation
At first Thank you. I watch your lecture regularly, my question to you which camara you use? or camara brand and model name please mention this.
Ur 😊 explanation is just wow
Thanks🙏🙇
czcams.com/video/RNXLD9jTcQ4/video.html
Thank you so much ma'am 💖
1??it is an integer and string is character type array having \0 at the end, is it possible to include integer in it??? Just asking as I am having confusion
1 is not just integer
'1' is treated as character also in C.
For example, in print statements where you want to print a number or menu, we print as :
printf("1.Option 1
2.Option 2
3.Option 3
");
Here the numeric symbols are treated as characters.
But in arithmetic (math) operations, the numeric symbols are treated as math numbers.
Eg :
int c= 5+3; // c=8 will be stored
So we can use 1 as number and '1' as character
So yes, you can include numbers in your strings too, where the number also will be treated as character.
Note :
//char ch=1; //wrong use
char ch= '1'; //ch stores '1' as character
printf("%c",ch); //will print 1
int num=1;
//int num='1'; //wrong use
printf("%d",num); //prints 1
num++; //correct
//ch++; //wrong bcoz ch is character and addition is done only on numbers, not characters
Mam, Iam from Mass, still watching your vedios for understanding humen technology.
mass!!!!!!!!! pe paani hai kya
your logic in always great
Mam you are a great teacher
Could you tell you are studied from which IIT
Mam plz explain process structure of c.
thanks for discuss it.
Queen of c language
Thanks for your efforts mam
Tomorrow is my C program Lab practical exam and here I'm watching it now 👅
very very nice teaching learning mam
thank u mam
czcams.com/video/RNXLD9jTcQ4/video.html
Ma'am Can you explain your lectures using java??
durga sir will help you i guess
@@amallearningwebdevelopment bhai meri job lagyi abb😂
Abb kya krunga mein
Mam I fall in your eye
Very very thank you mam 🎉😊.
Mam I am very pure in maths
even I don't coding also
Mam I can take cse (IT)
Please tell Mam
Mam how can reverse user input string with Preserving position of Space? Plz help
Awesome logic
You are the best 🤩
You are amazing 😌
Namskar mam, mai aapka ek subscriber hu, kya aap meri kuch madad kr skte hai. Mai apne computer me jaise hi keyboard plugin krta hu uske baad automatic files open hone lagti hai, automatic kuch letter type hone lgta hai, aur fir 1 se 2 minutes ke ander shut down ho jata hai. Maine 1) pc usb port bhi change kra liya 2) keyboard bhi change kra liya. 3) CZcams ke tricks bhi try kr liya fir bhi sahi nhi hua, ab aap bataye mai kya karu
Thanks alot mam
Thanks a lot mam 😊😊♥️♥️
Tnq u 😮
Thank u maam ❤️❤️❤️
Hello mam,
Iam placed as embedded software developer, recently.
Will this unacademy useful to me to improve my coding ?
Let me know briefly about it.
Thank you mam &
You are one of my best best faculty 💖.
I love the way , how you are teaching ✨...
#include
int main()
{
float f=0.1;
if(f==0.1)
{
printf("no");
}
}
Mam why if condition getting false here ,plz explain
i think if does not store float value
@@741ibrahim2 nahi..if so,compile time would have shown an error....it is compiling.
But ma'am u said while counting the length of string, we should not consider the null character.???
Thanku so much mam
Cute explanation
Mem kitne lecture or hoge
To complete c
Pls upload python play list mam
Why we don't use puts instead of printf?
draw a flow diagram to input your name and print it in reverse
Ye logic kahi to dekha he....😗 by the way thank you
Tq mam
mam lecture is good but plz try to avoid background sounds
I can't understand how a parameter can be a pointer, and how is it used as a string in strrev function??
why does gets function is not working in my compiler its giving me error
Ma'am when did you taught swapping of two numbers?
Mam this is a string or a array.
Can you give me solution of this
write a C program that create data structure that are larger than the amount of physical memory contained in their machine
Wuthout using string function yet u sue string function strlen why mam?
Best
czcams.com/video/RNXLD9jTcQ4/video.html
22:43 Kya Kar Rahi Hu😅😂
Cant we use two for loop??
Mam how to find greatest word from given sentence?
How many days did what to learn c language
Thanks mam. Please mam send me the C notes
at 4:42 you are a bit confused...i think mam
Mam can we take another string? Please check this
#include
#include
int main()
{int i,l;
char a[30];
char b[30];
printf("enter the string:");
gets(a);
l=strlen(a);
for(i=0;i
#include
#include
#include
void main()
{
char s1[30];
gets (s1);
int l=strlen(s1);
for(int i=l;i>=0;i--)
{
printf("%c",s1[i]);
}
}
Her name is not Jenny..........she is lying with the name only. What kind of teacher is she
MAINE AAJ AAPKO DWARKA SEC 19 AMBHARI GAON KE PASS DEKHA
You not used the strrev() function🙄
Gem!