C++ program to Check for Palindrome Numbers | C++ programming tutorials for beginners

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024

Комментарии • 86

  • @SimpleSnippets
    @SimpleSnippets  5 лет назад +15

    Hey Guys, if you want many more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends ✌

  • @sahithgondi1860
    @sahithgondi1860 3 года назад +6

    Very good tutorial.This makes it very easy to understand how everything works.

  • @محسنلاشاري-ه4ض
    @محسنلاشاري-ه4ض Год назад

    Well efforts sir, I tried every video on youtube but I got this

  • @abdulmasood1693
    @abdulmasood1693 2 года назад +5

    why is "num" stored to another variable "n". Why cant we just use "if(num==rev)"???

  • @saniyamansuri9607
    @saniyamansuri9607 3 года назад +1

    Enjoying coding all because of your channel 😀

  • @20_SinManya
    @20_SinManya 5 лет назад +14

    I have one doubt: Is '1001' is a palindrome (Note the single quotes before answering)?It would be very nice if you can show the program using strings.

  • @lordrageop7
    @lordrageop7 3 года назад +2

    Write a menu based C++ program to do the following operations using dedicated user defined function for each operation.
    a) square of a number
    b) factorial of a number
    c) whether prime or not
    d) whether even or not
    e) whether palindrome or not
    Plz solve this 🙏🙏

  • @kanaksharma5979
    @kanaksharma5979 4 года назад +5

    Thanku I really understanded this concept thanks for this video 👍👍😊😊🤗

    • @SimpleSnippets
      @SimpleSnippets  4 года назад +1

      Glad to hear that Kanak. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @ankitabanarase2631
    @ankitabanarase2631 6 лет назад +3

    Nice video ...concept was clear

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      Thank you so much buddy 😋😇 Happy to hear this from you. Please do share the video with your friends too ✌️

  • @antounshahin497
    @antounshahin497 4 года назад +5

    hey
    after we are done from the while loop and we start checking if the reverse is equal to our main number, why we didn't compare the num directly with the rev? why you assigned n to num the compare n to rev?
    I tried it and it gave me a wrong answer

    • @SimpleSnippets
      @SimpleSnippets  4 года назад +2

      Try to dry run the code step by step. take a pen and paper & note down all the variable values at each iteration to understand the full working. ✌

  • @Uzair.ur7
    @Uzair.ur7 9 месяцев назад +1

    Also a do a program of array elements check palandrom or not

  • @ronakbothra6371
    @ronakbothra6371 4 года назад +5

    Really helpful, also a black background would have been better

    • @SimpleSnippets
      @SimpleSnippets  4 года назад +4

      Thanks Ronak. There's a scientific reason to not go with dark theme with doing video recording. That's because the text on dark theme is not as clear as text on white theme especially at lower resolutions. You can try to verify this. Personally I love dark theme myself. It's just not optimum for video recordings 😊

  • @GaneshKumar-mo3ei
    @GaneshKumar-mo3ei 5 лет назад +10

    Plz upload videos for gross salary, percentage and number conversion (i e., 11th practical programs)🙇😋

  • @aryanmadhavverma
    @aryanmadhavverma 7 лет назад +21

    You're going to make me top my cs exam 😂

    • @SimpleSnippets
      @SimpleSnippets  7 лет назад +6

      +Aryan Madhav Verma thank you so much buddy for such a positive feedback buddy. I'm sure you'll do great in your exam 😎✌😇 all the best and do share the videos with your friends so that it'll help them as well 😎

  • @mahadihasan7300
    @mahadihasan7300 2 года назад +1

    Many Many Thanks 😍😍😍

  • @snehabankapur4635
    @snehabankapur4635 4 года назад +3

    HOW DO U INCREMENT REV BY ONE??

  • @iashutoshsahni
    @iashutoshsahni 4 года назад +2

    Well explained bro...

    • @SimpleSnippets
      @SimpleSnippets  4 года назад

      Glad you liked it. Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @nitya_sathish
    @nitya_sathish 4 года назад +6

    Hey, this tutorial is very helpful. But, how would we change the code if we want to use a negative number? Ex: if num = -121, then rev should equal 121-, and should output not palindrome.

  • @shreeshupadhyay8845
    @shreeshupadhyay8845 5 лет назад +2

    great work man

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

      Thank you bro 😊. Please do share the videos with your friends too ✌️

  • @newsamplifier
    @newsamplifier Год назад

    Thanks Man.

  • @ssseoks
    @ssseoks 4 года назад +1

    Your are genius

    • @SimpleSnippets
      @SimpleSnippets  4 года назад

      Heheh not really but thanks I am flattered 😅😅 Please do share the videos with your friends too ✌

  • @rdxdevil5083
    @rdxdevil5083 Год назад

    Computer doesn't understand like human because as we know that the reverse number of 121 will be 121
    But computer' result wil outcome
    By some mathmatics calculations....

  • @fade3302
    @fade3302 6 лет назад +3

    You're a hero bro😊

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      Wow buddy, that you so much for such a wonderful response. I'm so happy to hear your positive feedback and to know that this video was informational for you. Do share the videos with your friends and contacts and keep sharing the knowledge buddy 😇

  • @kavirajsk6159
    @kavirajsk6159 5 лет назад +1

    Dude instead of using while loop you can use stringrev

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад +1

      True that. Was trying to not use any inbuilt functions to explain actually how it works✌️😊

  • @faiyazmahmud5580
    @faiyazmahmud5580 3 года назад +1

    THANKS A LOT

    • @SimpleSnippets
      @SimpleSnippets  3 года назад

      You're welcome! Please do share the videos and channel with your friends too. Thats the biggest help and support you can give back to our channel!

  • @sharifullahdanish4480
    @sharifullahdanish4480 3 года назад +1

    Sir, you could please make a video regarding palindorm in C++ using stack...
    and one issue with this code is that for the first time the result is correct but when I used do while loop for asking the user whether they want to repeat this process or not, for the second time the result is incorrect for the same palindrom number.

  • @mariav1234
    @mariav1234 5 лет назад +1

    Nice! Thanks.

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад

      Most welcome buddy. Please do share the video with your friends 😇

  • @masoomajameel1557
    @masoomajameel1557 Год назад

    u r great

  • @mo24338
    @mo24338 2 года назад

    You are awesome

  • @avaneesha9571
    @avaneesha9571 3 года назад

    Thank you

  • @roshanbohara8834
    @roshanbohara8834 3 месяца назад

    While solving for 202 in second iteration I got 10 and at the 3rd iteration I got 20, by 1 and 3 iteration by adding it will be 202 I guess but what about that 10?? at the second iteration

  • @sallamrady8615
    @sallamrady8615 5 лет назад +1

    very good

    • @SimpleSnippets
      @SimpleSnippets  5 лет назад +1

      Thank you so much 😊✌️
      Please do share the videos with your friends too 😊

  • @abirsonet925
    @abirsonet925 2 года назад

    thnk you

  • @Ayush-qv5xs
    @Ayush-qv5xs 7 лет назад +1

    Awesome!

    • @SimpleSnippets
      @SimpleSnippets  7 лет назад

      +ayush sharma thank you so much for your positive response buddy ✌😇

  • @sidharthharidas8336
    @sidharthharidas8336 7 лет назад +3

    This is a great video.....but when I tried it myself (C++ 4.5) I couldn't get desirable results. It says its not a palindrome. please help!

    • @SimpleSnippets
      @SimpleSnippets  7 лет назад

      It should workout fine buddy. There's no alternative that I have tried but you can google palindrome program for C++ and you will get it. Also try downloading this Dev C++ IDE and try it there. I should work. Lastly you basically know the logic and algorithm of how it works right. So maybe you can try out some other possible combinations to see if it works. ✌

    • @sidharthharidas8336
      @sidharthharidas8336 7 лет назад +1

      I downloaded dev c++ and it worked perfectly....thank u so much......

  • @antonkarasev4173
    @antonkarasev4173 Год назад

    This prog doesn't work with 0 > numbers and numbers > =10**9, so i don't find it useful

  • @frodobaggins4159
    @frodobaggins4159 7 лет назад +2

    Y you skipped last step 1%10 and directly told we will get some value and wrote reverse directly?

    • @SimpleSnippets
      @SimpleSnippets  7 лет назад +5

      Hello, in the last iteration num=1 correct. so lets try and dryrun the part inside the loop.
      in the first line we have :
      digit = num%10.
      % sign is mod sign which will give us the remainder and not the quotient. so 1mod10 = 1
      so digit = 1
      now on the next like we have rev = (rev*10)+digit.
      rev was already 12 so multiplying it by 10 we get 120 and adding the digit variable which is 1 we will get
      rev=121
      last statement is num = num/10
      now / is for division so we get the quotient. num is 1. so 1/10 = 0. so the new num =0
      so when the loop again tries to execute we have num=0 hence the loop execution stops as the while loop executes only till the num is not equal to 0. which means the moment num=0 the loop will stop iterating.
      thats why I didnt emphasize much on the last step

  • @ushajose2377
    @ushajose2377 4 года назад +2

    Thank youu🙏🙏

    • @SimpleSnippets
      @SimpleSnippets  4 года назад +1

      Most welcome Usha, please do share the videos with your friends too 😇

  • @rachitsharma804
    @rachitsharma804 6 лет назад +1

    thx bhai jaan bachali

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      You're welcome buddy, happy to hear that this video helped you. Do share it with your friends and contacts so that even they get help from this video. ✌

  • @051sudharsan8
    @051sudharsan8 5 лет назад +1

    Nice

  • @nidhisahu9500
    @nidhisahu9500 6 лет назад +1

    Why we consider the 10 number

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      Where exactly? We're dealing with the decimal number system that's why I guess.

  • @rohan397
    @rohan397 6 лет назад

    Thanks

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      You're always welcome buddy ✌
      Do share the video with your friends and contacts 😇

  • @rahulgandla1701
    @rahulgandla1701 4 года назад +1

    It doesn't work for bigger numbers like 123456787654321

  • @allrounder2367
    @allrounder2367 2 года назад

    Didn't got it

  • @ridaeman68
    @ridaeman68 2 года назад

    Why here we take value of 10

  • @beemolpuri6103
    @beemolpuri6103 6 лет назад +1

    I need more help

  • @KTKOUSHIKBEC
    @KTKOUSHIKBEC 4 года назад +1

    👍👍

  • @sivakumarm8900
    @sivakumarm8900 6 лет назад +5

    #eat #sleep n #code

  • @rfjsr3417
    @rfjsr3417 3 года назад

    Aisa Program type krne k kya faida jo read hi nai kiya ja sake.
    Bhai sahab apne jo program type kiya hai logon ko usko read krne me Microscope ka use krana prega.

  • @mangeshtrimbake3170
    @mangeshtrimbake3170 3 года назад

    check it for value 1234567899 ie 10^10

  • @vibhootinageshwar6110
    @vibhootinageshwar6110 6 лет назад +1

    Thanks

    • @SimpleSnippets
      @SimpleSnippets  6 лет назад

      Most welcome buddy :-)
      I would request you to please share the video with your friends and contacts. That will be the best help :-)

  • @mahektiwari3842
    @mahektiwari3842 4 года назад +1

    Thanks

  • @cuteminired6550
    @cuteminired6550 Год назад

    thanks