Frequently Asked Java Program 02: Reverse A Number | 3 Ways of Reverse a Number

  Рет қаралды 396,762

SDET- QA

SDET- QA

4 жыл бұрын

Topic: Reverse a Number ( 3 Different ways)
#########################
Udemy Courses:
#########################
Manual Testing+Agile with Jira Tool
************************************
► shorturl.at/xNXZ4
Selenium with Java+Cucumber
********************************
► shorturl.at/aIKMW
Selenium with Python & PyTest
********************************
► shorturl.at/ELW09
Selenium with python using Robot framework
****************************************
► shorturl.at/bcDPZ
API Testing(Postman, RestAssured & SoapUI)
*****************************************
► shorturl.at/uAWY7
Web & API Automation using Cypress with Javascript
********************************************
► rb.gy/4uum2n
Playwright with Javascript
**************************
► shorturl.at/gALZ1
Jmeter-Performance Testing
************************
► rb.gy/ocj7r2
SDET Essencials(Full Stack QA)
*************************
► rb.gy/hlnf2v
Appium-Mobile Automation Testing
************************************
► rb.gy/wmzv64
Java Collections
*****************
► bit.ly/3S66ezE
Python Programming
*********************
► urlis.net/gdsfpb0s
Cucumber BDD Framework
***************************
► bit.ly/3F7d69r
Protractor with Javascript
***************************
► urlis.net/4uddm1qb
####################################
KZfaq Playlists:
####################################
Manual Testing & Agile
***********************
► bit.ly/3ujvaYa
► bit.ly/3OYzxQj
SQL
*************************
► bit.ly/3R6XjeG
► bit.ly/3nE0a1s
► bit.ly/3IeKuuJ
linux & Shell Scripting
**********************
► bit.ly/3up1Z6a
► bit.ly/3nzvGxx
Java
**********************
► bit.ly/3R9QfOs
► bit.ly/3AoRMKM
► bit.ly/3IbTTDn
► bit.ly/3ybXInv
► bit.ly/3yCoHdw
Selenium With Java+Cucumber
********************************
► bit.ly/3P2FMm4
► bit.ly/3yhiIt4
► bit.ly/3uokzet
► bit.ly/3a7XIND
► bit.ly/3umN2S9
► bit.ly/3aar7GW
► bit.ly/3y9kD2S
► bit.ly/3uhLskn
Python
********************************
► bit.ly/3agNgU0
► bit.ly/3NJNnoy
► bit.ly/2CTQ4mR
► bit.ly/3OIYWh1
Selenium With Python,Pytest&Behave
***************************************
► bit.ly/3OHHoC9
► bit.ly/3IeNLdv
► bit.ly/2J4tPeT
► bit.ly/3ydSkAq
Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************
► bit.ly/3nUvlpr
► bit.ly/3nUvE3z
API Testing (Postman,SoapUi,&Rest Assured)
**********************************************
► bit.ly/3OXacWY
► bit.ly/3yh0UhE
► bit.ly/3nC9DWQ
► bit.ly/3yGfhNS
► bit.ly/3OJa11H
► bit.ly/3P2slCC
Mobile App Testing Appium
****************************
► bit.ly/3Al49HG
Performance Testing Jmeter
*******************************
► bit.ly/3nz4fE7
Maven,Jenkins,Git,Github,CI/CD
*******************************
► bit.ly/3P16HPj
► bit.ly/3yhlUVA
► bit.ly/3afYfwT
► bit.ly/3yGzweG
► bit.ly/3yF73Ws
► bit.ly/3NCOmH7
SQL,DB Testing&ETL,Bigdata
*******************************
► bit.ly/3NKOcNY
► bit.ly/3OVpDyI
► bit.ly/3NEvUy0
► bit.ly/3IryxlT
► bit.ly/3RkWBLh
JavaScript Based Automation Tools
********************************
► bit.ly/3nUx51X
► bit.ly/3AqI6Q0
► bit.ly/3yeurbT
► bit.ly/3ujzpTK
Selector Hub Tools
********************
►rb.gy/h3h424
GraphQL
******************
► rb.gy/sj3gys
Cypress API Testing
********************
► shorturl.at/fjKPX
Cypress Web Testing
**********************
► shorturl.at/agjlK
Playwright with Javascipt
**************************
► shorturl.at/adSTY
#JavaNumberReversal
#ReverseNumber
#JavaProgramming
#CodeReversal
#JavaTips
#NumberManipulation
#ProgrammingHelp
#JavaBeginner
#CodingChallenge
#Java101
#CodingCommunity
#LearnJava
#JavaTricks
#CodeSnippets
#ReverseInteger
#JavaDevelopment
#ProgrammingQuestions
#Algorithm
#JavaAlgorithms
#CodingProblems
#CodingSolutions
#TechInterview
#CodingSkills
#JavaHelp
#ReverseDigits
#JavaLearning
#ProgrammingLogic
#JavaProblems
#JavaCode
#CodeExamples
#ReverseAlgorithm
#JavaCommunity
#CodingTutorials
#ReverseNumberLogic
#JavaChallenge
#SoftwareDevelopment
#ProblemSolving
#ProgrammingLanguages
#JavaCodeSnippet
#ReverseNumberFunction
#JavaPuzzle
#ProgrammingJourney
#JavaCoders
#JavaPractice
#CodeReview
#AlgorithmDesign
#JavaMentorship
#JavaDev
#ProgrammingProblems
#JavaCodingTips

Пікірлер: 168
@crazychengu359
@crazychengu359 3 ай бұрын
Who are here in 2024!
@otakusonline1487
@otakusonline1487 Жыл бұрын
2 Years later and this video explained perfectly to assist me with my AP CS Class. Thanks man.
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@pavanichella
@pavanichella 2 жыл бұрын
I always wanted these logics.Guess i found the right channel .Thanks a ton sir!
@iynesh07
@iynesh07 2 жыл бұрын
Everything is awesome... just a small correction: % : This is called remainder operator, which gives the remainder as output. as in 123%10 gives 3 as remainder. and / : this is division operator and gives the value after division. as in 123/10 gives 12.3 as answer but if you have taken it as int then it will give 12.
@varisha6758
@varisha6758 2 жыл бұрын
It divides left-hand operand by right-hand operand and returns remainder and is called as (Modulus) not remainder operator
@jayeshpatil6439
@jayeshpatil6439 Жыл бұрын
Thanks, I was confused and watched the video 2 times and then read this comment. Now got cleared... The creator is using a strategy to increase watch time.
@ibbishariff
@ibbishariff Жыл бұрын
@@jayeshpatil6439 No, the creator is doing a great job. You need to brush up you basics.
@jayeshpatil6439
@jayeshpatil6439 Жыл бұрын
@@ibbishariff yes, thanks...
@Vijaykumar-be1ne
@Vijaykumar-be1ne 4 жыл бұрын
Thank you very much sir make more videos related to strings and arrays also
@SFL1484
@SFL1484 2 жыл бұрын
WOWWWW.... FINALLY!!!!! Well explained. Great teaching. THANK YOU
@sdetpavan
@sdetpavan Жыл бұрын
welcome
@samarthk9366
@samarthk9366 2 жыл бұрын
You explained programming very well, easy to understand.. Thank you sir
@sdetpavan
@sdetpavan Жыл бұрын
You are most welcome
@whatisinthenameshakespeare0015
@whatisinthenameshakespeare0015 2 жыл бұрын
I think the input taken sc.nextInt can result in exception if user enters non number or mixed input... we should handle it in a better way
@korebhagath3976
@korebhagath3976 2 жыл бұрын
Sir can we revers float and double values by using string buffer and string builder
@showme13100
@showme13100 Жыл бұрын
Excellent explanation. Even a nontechnical guy like me can comprehend easily. Thanks a lot, sir
@sdetpavan
@sdetpavan Жыл бұрын
You are most welcome
@akshayar3474
@akshayar3474 4 ай бұрын
thank you sir for this explanation it is really helpful ,i have doubt if we dont use scanner class is there any mistakes
@kennyi1200
@kennyi1200 2 жыл бұрын
I liked here StringBuilder option the most. For 12300 it returns us 00321 but Option1 - Modulus one returns just 321 which is not good. Also, for numbers more than 9-10 digits Option 1 doesn't work but StringBuffer and StringBuilder comes over well . Thanks for the video !
@sakshigupta7569
@sakshigupta7569 2 жыл бұрын
kzfaq.infoH2z9YYe0Yvw?feature=share
@sundramyadav5934
@sundramyadav5934 3 жыл бұрын
Thank you so much sir for providing very useful videos for free.
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@gulshansurya4840
@gulshansurya4840 2 жыл бұрын
Very clearly and deeply explained. Thank a lot sir! Great Work!
@sakshigupta7569
@sakshigupta7569 2 жыл бұрын
kzfaq.infoH2z9YYe0Yvw?feature=share
@sdetpavan
@sdetpavan Жыл бұрын
My pleasure
@vishalbandi6742
@vishalbandi6742 Жыл бұрын
i think we can also reverse integer or string by using FOR loops ...
@shareefshaik5920
@shareefshaik5920 4 жыл бұрын
When there is easy methods string buffer and builder they why to go for algorithm ?
@gauri992
@gauri992 3 жыл бұрын
You explain it the best way thanks a lot sir...
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@rachamallidorasrivignesh4499
@rachamallidorasrivignesh4499 Жыл бұрын
tq sir please make more on aptitude we are waiting for ur classess anna
@priyankajadhav6611
@priyankajadhav6611 6 ай бұрын
You are best teacher in the world ,yours teaching skills is awesome sir
@sdetpavan
@sdetpavan 5 ай бұрын
Thanks
@tedclayton4509
@tedclayton4509 Жыл бұрын
How come when I use the same endpoints you're using my program isn't as reactive as yours. In other words as I hover over "rev" I should see 4 and then 43 etc.
@hemmishra1102
@hemmishra1102 Жыл бұрын
Thank you, I was looking for such series in hindi. Thank you again
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@sasikumarchunduri6179
@sasikumarchunduri6179 2 жыл бұрын
Thank you so much very clear explanation
@sdetpavan
@sdetpavan Жыл бұрын
You’re welcome
@jayalakshmikrishnan1956
@jayalakshmikrishnan1956 Жыл бұрын
Sir , If i have enetered 121820, with 1st method its showing as 28121, ideally it should be 028121, its stripping the zero here please suggest!
@asharaju4169
@asharaju4169 4 ай бұрын
Why need to append when using string builder? it also has inbuilt reverse method...so why not use it directly....only that logic i didn't get...somebody please...
@anshuhyderabad
@anshuhyderabad 4 жыл бұрын
Hello , I think 2nd and 3rd methods are same. I think 3rd one can be like converting number to string and then using charAt method to extract each char and then appending to the sting builder int origNum = 123456; String stNum = String.valueOf(k); StringBuilder revStg = new StringBuilder(); for (int i = stNum.length()-1; i>=0;i--) { revStg.append(stNum.charAt(i)); } System.out.println(revStg); } }
@nayabshaik2282
@nayabshaik2282 Жыл бұрын
Great thanks you sir ☺. You are simply awesome.. coding med interest leni naaku, meerichhe explanation tho interest vachhestundi.. I am practcing well. Once again Thank you very much sir 🙏
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@manasipawar7941
@manasipawar7941 3 жыл бұрын
But sir , number enter to 1230 this no not reverse 0321 .. Output is 321 so 0 is eliminate so plz suggest logic for last digit 0
@rajasekhar3977
@rajasekhar3977 Жыл бұрын
Use stringBuffer or stringBuilder methods
@shankardeepak-pr9bl
@shankardeepak-pr9bl Жыл бұрын
Int num = 12340; int rev = 0 ; While(num!=0) { rev = (rev*10) + num%10; num/=10; } System.out.println(rev); Try this 👍
@dh1713
@dh1713 8 ай бұрын
​@@shankardeepak-pr9blStil removes the zero (:
@giriyt
@giriyt 7 ай бұрын
​@@shankardeepak-pr9bl not worked
@GuganSubramaniam
@GuganSubramaniam 6 ай бұрын
Use while(num>=0)
@aalanagirls7778
@aalanagirls7778 4 жыл бұрын
thank you ,please upload more java programs...
@Horodgamin
@Horodgamin 4 жыл бұрын
See more here:kzfaq.info/get/bejne/eMxxfc58qa64gZ8.html
@thechitrolekha4352
@thechitrolekha4352 Жыл бұрын
My exams are nearing and I found this video. This is so useful. Thank you sir
@sdetpavan
@sdetpavan Жыл бұрын
You are most welcome
@ashokkadam123
@ashokkadam123 Жыл бұрын
Very Nice Explaination...Thank You Sir...!!!
@sdetpavan
@sdetpavan Жыл бұрын
You are most welcome
@fitnessgurl1396
@fitnessgurl1396 2 жыл бұрын
oh wow you are superb the way of explanation great sir am preparing for gsoc wish it help me
@sakshigupta7569
@sakshigupta7569 2 жыл бұрын
kzfaq.infoH2z9YYe0Yvw?feature=share
@manojkuna3962
@manojkuna3962 2 жыл бұрын
Thank you sir 🙏
@eswarec1422
@eswarec1422 Жыл бұрын
Perfect Explanation ❤️🙌🏻
@sdetpavan
@sdetpavan Жыл бұрын
Glad it was helpful!
@subrahm
@subrahm 2 жыл бұрын
Sir what is the use of append method sir??
@yasithnirmalpeiris7196
@yasithnirmalpeiris7196 18 күн бұрын
can we do that using a string concat
@cheremokhothu6596
@cheremokhothu6596 3 жыл бұрын
how do you add space in the middle
@Pavan_Gaekwad
@Pavan_Gaekwad Жыл бұрын
Such a good explanation , Sir 😊
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@busisiwemailula
@busisiwemailula Жыл бұрын
Thank you so much ❤did this for my assignment
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@vivekpaul8104
@vivekpaul8104 3 жыл бұрын
Very neat and clean explanation sir.....keep up👏
@sakshigupta7569
@sakshigupta7569 2 жыл бұрын
kzfaq.infoH2z9YYe0Yvw?feature=share
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@DoItBySuren
@DoItBySuren 4 жыл бұрын
Best explanation ever.
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@raghu9997
@raghu9997 8 ай бұрын
Thank you so much sir 🎉 Great explanation ❤
@sdetpavan
@sdetpavan 7 ай бұрын
Most welcome
@calsoftdev8722
@calsoftdev8722 2 жыл бұрын
your explain is very clear ,it ease to understand
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@Mahi-rh1li
@Mahi-rh1li 4 ай бұрын
Sir If we give input as 67890 then 0 is being ignored and output displaying 9876..What logic can we add in order to not ignore zero as well?
@dhirendradubey7374
@dhirendradubey7374 9 ай бұрын
perfect job
@user-dj4qj9ms7t
@user-dj4qj9ms7t 3 ай бұрын
Thank you for explaining in very easy manner
@sdetpavan
@sdetpavan 3 ай бұрын
Glad it was helpful!
@beditz1591
@beditz1591 Жыл бұрын
Respected sir please help I came in this video from your Udemy course selenium with java+ cucumber... I watched your video until 6(conditional statement & looping statement) and i came here for assignment...i watched your video but here I couldn't understand idk sir plz help me...and try to re upload your video...and why you didn't solve assignment in udamy😥😢
@pakkirareddy1237
@pakkirareddy1237 Жыл бұрын
how to enable explanation steps in eclipse sir
@yashumate3404
@yashumate3404 Жыл бұрын
Sir direct aisa likh sakhte hai kya??... Example 1234 ko reverse Karo bole Aur apan ne aisa direct likha toh?? public class Main { public static void main(String[] args) { int rev=4321; System.out.println("Reverse number is " + rev); } } Aisa karke output 4321 aah raha
@felixgilbert3473
@felixgilbert3473 3 жыл бұрын
Thanks you please upload for beginners
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@ashutoshrai2717
@ashutoshrai2717 Жыл бұрын
Sir which editor are you using
@Sandeepchandrabose
@Sandeepchandrabose 2 ай бұрын
Sir, first method won't work if we try to reverse *'00111'* right as we will get *37* as output. static int reverseNumber(int num) { int rev = 0; while (num != 0) { rev = rev * 10 + num % 10; num /= 10; } return rev; } System.out.println(reverseNumber(00111)); Output = 37
@rockgemini
@rockgemini 2 жыл бұрын
What about reversing a number like 67890 with the algorithm mentioned here? It will not consider 0 and will only print 9876.
@poojachandavar1762
@poojachandavar1762 2 жыл бұрын
we can u the recursion method, try this :) import java.util.Scanner; public class ReverseNumberExample3 { //method for reverse a number public static void reverseNumber(int number) { if (number < 10) { //prints the same number if the number is less than 10 System.out.println(number); return; } else { System.out.print(number % 10); reverseNumber(number/10); } } public static void main(String args[]) { System.out.print("Enter the number that you want to reverse: "); Scanner sc = new Scanner(System.in); int num = sc.nextInt(); System.out.print("The reverse of the given number is: "); //method calling reverseNumber(num); } }
@-SatyajitSahoo-
@-SatyajitSahoo- 5 ай бұрын
Splendid explaination sir 💯
@sdetpavan
@sdetpavan 5 ай бұрын
Thanks
@rumanir
@rumanir 4 жыл бұрын
please collection videos need for interview
@aries2aqua
@aries2aqua 2 жыл бұрын
Thanks so much for this
@sdetpavan
@sdetpavan Жыл бұрын
You are so welcome!
@narisap.1038
@narisap.1038 2 жыл бұрын
Thank you so much.
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@vivekayadi9299
@vivekayadi9299 2 ай бұрын
Explanation is excellent but,the xor u said that is not correct it would be bidirectional then if the values are same its 1 otherwise its 0
@kvelez
@kvelez 10 ай бұрын
This one was super cool
@sdetpavan
@sdetpavan 10 ай бұрын
Thanks
@zayb007
@zayb007 Жыл бұрын
Sir can u please explain about append()
@SQUADYYT
@SQUADYYT 2 жыл бұрын
love u sir
@mdarifhossainchowdhuary1799
@mdarifhossainchowdhuary1799 4 жыл бұрын
Thanks for your all videos. Can you make some video for DataStructure and Algorithm
@kummarisudhamani3706
@kummarisudhamani3706 Ай бұрын
How to identify that logic sir rev=(rev*10)+num/10
@nishatislam3495
@nishatislam3495 3 жыл бұрын
thank you very much
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@sodaspicy6137
@sodaspicy6137 3 жыл бұрын
Thank you!
@sdetpavan
@sdetpavan Жыл бұрын
You're welcome!
@chandrashekharb6567
@chandrashekharb6567 5 ай бұрын
Hi Sir , Can you please explain how 1234/10 will be 123 Is it beacuse we are eliminating the decimal value because we have passed the variable has int =1234
@mahimamadhukar4972
@mahimamadhukar4972 2 ай бұрын
Try this public class Reverse { public static void main(String[] args) { int num = 12635; String rev = ""; int rem = 0; while(num>=1){ rem = num%10; rev = rev + rem; num = num/10; } System.out.println(rev); } }
@NikhilR07
@NikhilR07 Жыл бұрын
Excellent sir🤗
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@nvr7367
@nvr7367 4 жыл бұрын
Hi Bro, There is one more way public static String reverseNum(int num) { String reverseString = ""; String str = Integer.toString(num); char[] chr = str.toCharArray(); for (int i = 1; i
@arjunanselvam
@arjunanselvam 2 жыл бұрын
will it work -123?
@abhijeetbhatt9772
@abhijeetbhatt9772 3 жыл бұрын
for the first approach, it won't work with 230 or no module number. for 230 it will show 32 how can we achieve 032 that with the first method
@simrangupta1412
@simrangupta1412 3 жыл бұрын
import java.util.Scanner; public class ReverseNumber { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter a number"); String num=sc.next(); Integer num2 = Integer.parseInt(num); int count = 0; int count2 = 0; char[] s = num.toCharArray(); for (char s1 : s) { if(!String.valueOf(s1).equals("0")){ break; }else { count++; } } for(int k=s.length; k > 0; k--) { if(!String.valueOf(s[k-1]).equals("0")) { break; }else { count2++; } } //using algorithm int rev=0; while(num2!=0) { rev=rev*10 + num2%10; num2=num2/10; } int i = 0; String reverse = String.valueOf(rev); if(rev == 0) { reverse = ""; } while(i
@redhoodiepro8173
@redhoodiepro8173 Жыл бұрын
Excellent man
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@prachipatil5996
@prachipatil5996 2 ай бұрын
Why rev×10?
@nonegirl112
@nonegirl112 9 ай бұрын
Super sir grear teaching
@sdetpavan
@sdetpavan 9 ай бұрын
Thanks
@subhakar9015
@subhakar9015 3 жыл бұрын
package reversestring; import java.util.Scanner; public class ReverseString { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter the sentence::"); String stnce=sc.nextLine(); System.out.println(new StringBuilder(stnce).reverse()); } }
@bimaladulalsharma9190
@bimaladulalsharma9190 4 жыл бұрын
Well explained
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@neatdesign4159
@neatdesign4159 2 жыл бұрын
what if the last digit is 0, eg: 120 (I'm getting a wrong answer when the user enter an integer ends with 0)
@neatdesign4159
@neatdesign4159 2 жыл бұрын
found the solution, thanks anyways
@ajaywankhade5054
@ajaywankhade5054 6 ай бұрын
Thank u sir
@sdetpavan
@sdetpavan 6 ай бұрын
Welcome
@maheshreddygade8616
@maheshreddygade8616 3 жыл бұрын
That logic got failed if you give a number at last "0" like 890 output: 98 only
@rijo_tthomas3785
@rijo_tthomas3785 3 жыл бұрын
nobody is going to reply to this because no one knows
@nishatislam3495
@nishatislam3495 3 жыл бұрын
😆😆
@mohammadaasim7457
@mohammadaasim7457 3 жыл бұрын
@@rijo_tthomas3785 🤣
@2moredirections360
@2moredirections360 3 жыл бұрын
no bro its working fine.
@udaybenake206
@udaybenake206 3 жыл бұрын
Yeah I tried With 120 it is giving reverse O/P as 21
@user-qm7rb9vp8g
@user-qm7rb9vp8g 5 ай бұрын
i love you bro, May The Lord of all bless you
@shubhamshende9995
@shubhamshende9995 9 ай бұрын
Amazing 🎉
@sdetpavan
@sdetpavan 9 ай бұрын
thanks
@gsuresh1568
@gsuresh1568 Жыл бұрын
sir mobileNumber how to Write reverse
@datareport1582
@datareport1582 Жыл бұрын
Owasome
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@sadhamhussain1272
@sadhamhussain1272 2 жыл бұрын
01234 please tell us how to write program
@balakrishna5786
@balakrishna5786 2 жыл бұрын
Super
@sdetpavan
@sdetpavan 2 жыл бұрын
thanks
@chanidukarunarathna2126
@chanidukarunarathna2126 3 жыл бұрын
Wow
@sdetpavan
@sdetpavan Жыл бұрын
Thanks
@snehalghatage732
@snehalghatage732 Жыл бұрын
sir can you take mock interview??? we will pay for that. plz reply
@sdetpavan
@sdetpavan Жыл бұрын
I take free mock interviews. You can send your profile to my email ID. I will schedule an interview.
@snehalghatage732
@snehalghatage732 Жыл бұрын
@@sdetpavan thank you so much
@imagined7596
@imagined7596 8 ай бұрын
but 10 20 50 can't be reverse.. because the result is 05 02 01
@imagined7596
@imagined7596 8 ай бұрын
how the solution that problem sir.. thanks
@rajasekhar8650
@rajasekhar8650 4 жыл бұрын
Nageswara rao sir student😂
@saikiranpalugula802
@saikiranpalugula802 3 жыл бұрын
Sir is the below approach valid Int num = 1234; While(num!=0) { Int n = num%10; num = num/10; System.out.print(n); }
@sdetpavan
@sdetpavan 3 жыл бұрын
Right
@saikiranpalugula802
@saikiranpalugula802 3 жыл бұрын
@@sdetpavan Thanks for the reply sir
@Introvert_Explorer791
@Introvert_Explorer791 3 жыл бұрын
some noise sound is coming sir its annoying disturbing ur teaching and me also
@ShubhamMishra-lo6wz
@ShubhamMishra-lo6wz 3 жыл бұрын
Sir your StringBuffer approach is wrong as the the output will be a string type not an int type to convert this to int type you need to use below code String s = rev.toString(); int i = Integer.parseInt(s); System.out.println(i); Thank you
@meyheangnhem-9049
@meyheangnhem-9049 3 жыл бұрын
Hello
@HallOfMemeYT
@HallOfMemeYT 2 жыл бұрын
first approach is totally wrong and shouldnt be in practice , try reversing 100 using this approach , it will give only 1.which is not reverse.instead take a string input and use reverse string approach to reverse a number.Just for the time.
@aswinirobbi504
@aswinirobbi504 Жыл бұрын
i have written like this, is this correct way to write the code. int i= 1234; while(i!=0) { System.out.print(i%10); i=i/10; }
@indgameplaychannel
@indgameplaychannel 11 ай бұрын
System.out.println("Logic_3"); System.out.println("Enter Number"); Scanner sc=new Scanner(System.in); int num=sc.nextInt(); StringBuilder rev; //Using String Builder Class StringBuilder sbl=new StringBuilder(String.valueOf(num)); rev=sbl.reverse(); System.out.println("Reverse number is" + rev); This logic also workng for third logic
@GanesanDinesh
@GanesanDinesh Жыл бұрын
Hi, thanks for your videos Could you please check this import java.util.Scanner; public class ReverseNumber { public static void main(String[] args) { System.out.println("Please enter the number"); Scanner sc = new Scanner(System.in); String input = sc.nextLine(); System.out.println("User entered "+ input); //Method 1 StringBuffer sb = new StringBuffer(input); System.out.println("Reverse number is " +sb.reverse()); //Method2 StringBuilder sbi = new StringBuilder(input); System.out.println("Reverse number is " +sbi.reverse()); } }
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 15 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 62 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
How to solve any Star Pattern Program
18:47
Simply Coding
Рет қаралды 1,1 МЛН
Solve Any Pattern Question With This Trick!
57:20
Kunal Kushwaha
Рет қаралды 2,3 МЛН
Program to Reverse a Number in Java by Deepak
9:44
Smart Programming
Рет қаралды 278 М.
Reverse Integer | LeetCode problem 7
7:00
Technosage
Рет қаралды 18 М.
Frequently Asked Java Program 10: Generate Fibonacci series
9:50
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 15 МЛН