C programming Bangla Tutorial 5.192 : String | String reverse without strrev()

preview_player
Показать описание
All C programming videos:
Рекомендации по теме
Комментарии
Автор

apnr jnno ami & amr bandhubi somaj namaj aday kre duya krbo, allah apnk, apnr baccha kaccha ke, nati natni ke nek hayat dan koruk .. google e amra apnk dekhte chai .. asolei mn theke onk besi valobasha niben🥰😇💞💓💗💖💝❣💕

meghlaislam
Автор

we can make it simpler.

#include<stdio.h>
int main()
{
char strFirst[20] = "I am Human";
char strSecond[20] ;
int length=0, j;

while (strFirst[length] != '\0' )
{
length++;
}

for(j=0; length>=0; length--, j++)
{
strSecond[j] = strFirst[length-1];
}

printf("first string : %s \n", strFirst);
printf("Reverse string : %s", strSecond);
return 0;
}

Автор

sir 2 ti for loop die ki kora jabe na ?

mdsamiuzzamanreal
Автор

I guess this code below is a lot easier to understand

#include<stdio.h>
int main()
{
char str1[]="aritra debnath";
char str2[30];

int len=0, i=0;

while(str1[len]!='\0')
{
len++;
}

for(i=0;i<len;i++)
{
str2[i]=str1[len-1-i];
}

printf("the reversed string is \"%s\"", str2);
}

aritra
Автор

Shash r index ta 11 kno count kora hoyeche ekhne total jhetu 12 chilo ami ei bprta clearly bujhte parchi na

anirudhamajumder-bpuw
Автор

2ta string declare kora charao reverse kora jete pare..

#include <bits/stdc++.h>
using namespace std;
int main() {

char a [30] = {"Anisul Islam"};

int i = 0, size=0;
while ( a[i]!='\0' ) {
size++;
i++;
}

for ( int i = size; i>=0; i-- ) {
cout<<a[i];
}

return 0;
}

khhniloy
Автор

আমি চাচ্ছি এমনঃ-
Input:- There is a word.
Output:- ereth si a drow.
মানে শব্দের স্থানের কোনো পরিবর্তন হবে না। কিভাবে???

watchofficial
Автор

Amra reverse korar shohoj niyom ta rekhe eto jhamela jabo keno?
Kono competitive programme a emon ta ashe?

bolajabenahmm
Автор

Vaiya, if i can do reverse by strrev() function then why i will chose this difficult one(without strrev function)?

abubakarsiddique
Автор

vaiya ami jokhon nam er age space dei tokhon thik thake nahole reverse er shomoy akta word baad pore jay. kno??

historyofgamez
Автор

sir len -1 kno dite hobe
bujte parci na

amerbangla
Автор

vaia ai jagai len=strlen ata declare korar dorkar holo na kno?

ashikurrahman
Автор

This code easily:

#include<stdio.h>
#include<string.h>
int main()
{
char str1 [] = "Joy";
char str2 [30];

int i, len;
len = strlen(str1);
for (i=0; i<len; i++)
{
str2[i] = str1[len-1-i];
}
str2[i] = '\0';
printf("%s", str2);

}

dayztimeap
Автор

Apner video gular kontr pot konta dakbo buja jay na..tai jodi class number add Koran..maybe vlo hy

TanjidHossainAmran
Автор

Via akhane akta string niye kivabe kora jabe jekhane apni str2 use koresen ami chacci je one string korte jodi help korten☺☺☺☺

md.labib
Автор

Easier Version:
int main()
{
char s[]="joe Mama";


int i, j, length;

length=strlen(s);

for(i=0;i<=length;i++)
{
printf("%c\n", s[i]);
}

printf("reverse\n");
for(i=length;i>=0;i-- )
{
printf("%c", s[i]);
}





getch();
}

joe_mama
Автор

Sir...
str2[j]='\o'

nal charecter ta last e kivabe set hoilo?
tokhon (j) er man koto chilo?

seniorvai
Автор

#include<stdio.h>
#include<string.h>
int main()
{
/*char str[]="Tushar Ahmed";
strrev(str);
printf("STR = %s\n", str);*/
char str1[30]="Tushar Ahmed";
char str2[30];
int i=0, len=0, j;
while(str1[i] !='\0'){
i++;
len++;
}
for(j=0, i=len-1;i>=0;i--, j++){
//ai line kon niyom e lekha hoy?1 line e 2 kaj kibabe?
str2[j]=str1[i];
}
str2[j]='\0';
printf("STR1 = %s\n", str1);
printf("STR2 = %s\n", str2);
return 0;
}

tusharahmed