Program to calculate sum of digits of a number in C language

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 142

  • @kriticksharma3088
    @kriticksharma3088 6 років тому +29

    Gurudev aap Mahaan Ho👏👏🙌🙌

  • @mamtamaurya7208
    @mamtamaurya7208 6 років тому +17

    Really i am very thankful to you sir.. jst bcoz of yur videos.. i am able to get the logic correctly and implement it in the programs

  • @techsupport5637
    @techsupport5637 6 років тому +4

    Thank You sir, for making this programming videos ,this is very useful for me. I am getting understand each and every concept clearly.

  • @abhishekyadav-nq3ir
    @abhishekyadav-nq3ir 4 роки тому +2

    Hats of to you sir urs teaching style is totally ddifferent

  • @amitnepali5908
    @amitnepali5908 3 роки тому +4

    Your teaching style is magnificent 😋🤣
    Loved it sir
    New concept
    Think Output And write program 😋

  • @siddharth4802
    @siddharth4802 2 роки тому

    Thank you verrrrrrry much sir, searched a lot for this program , finally found an excellent one

  • @celebrityreels5415
    @celebrityreels5415 3 роки тому +1

    Sir I m not usually commented but sir you explained it in a very effective manner,keep doing sir!!👍

  • @sspatel.indias
    @sspatel.indias 4 роки тому +2

    Super se upar sir ji....

  • @VishalSharma-jx9in
    @VishalSharma-jx9in 4 роки тому +1

    Sir aapka samzhna lajawab hai
    Thanks sir thanks 🙏

  • @swatilangi196
    @swatilangi196 6 років тому +3

    Khupach chan sirrr....aapaki vajese mera spa jarur pass hoga...awesome sirrr

  • @CodeWithMayur-Mayur
    @CodeWithMayur-Mayur Рік тому

    Wow. What a explanation. Thank you so much sir.

  • @jyoti6727
    @jyoti6727 5 років тому +4

    You are the god for me sir .........☺️☺️☺️

  • @niteshsingh3336
    @niteshsingh3336 6 років тому +1

    sir main apke videos dekhne se pehle he like kar deta hoon becase i fully confident that this topic is clear

  • @heetdoshi200
    @heetdoshi200 3 роки тому

    Awesome video Sir
    Really Best ..thank you Sir.

  • @jayantadutta6048
    @jayantadutta6048 Рік тому

    Awesome explanation Sir........ Thank you Sir....

  • @AnilKumar-hr5uq
    @AnilKumar-hr5uq 4 роки тому

    Sir
    Mai pehle khud logic bana ke phir aapse match karke program banata hu thanks guru g

  • @soumitadutta9081
    @soumitadutta9081 6 років тому +10

    I did it by myself sir and I used for loop and logic was almost same and my dry run and compiled ans both are perfect

  • @Vvvv86434
    @Vvvv86434 7 років тому

    thanku so so so so so so much for this vedio...after many days my problem was solved

  • @in-depthuniverse
    @in-depthuniverse Рік тому +1

    Amazing ❤❤

  • @BPEntertainment58
    @BPEntertainment58 8 років тому

    you are a good trainer sir! nice!..bahut aachee se samjhate hai

  • @IRSHADAHMAD-kd8jk
    @IRSHADAHMAD-kd8jk 5 років тому +1

    sir ji aap kaa video is a super hai video

  • @programmer2.o734
    @programmer2.o734 3 роки тому

    Outstanding sir 👍

  • @MR.XEducation
    @MR.XEducation 3 роки тому

    bahot achha batate hai sir thank you very much

  • @abdullahjaved5855
    @abdullahjaved5855 5 років тому +2

    you are really awesome

  • @Kushawaha14
    @Kushawaha14 7 років тому +2

    Awesome videos...

  • @dharamveerkumar8333
    @dharamveerkumar8333 6 років тому +2

    Your channel is underrated....
    Even though you gave very good c tutorial

  • @Chandan-xz8cd
    @Chandan-xz8cd 6 років тому +2

    mazaa aa giya sir g

  • @krishanudutta2943
    @krishanudutta2943 4 роки тому

    You are awesome sir

  • @muhammadyousaf4452
    @muhammadyousaf4452 4 роки тому

    Great👍

  • @jayantadutta6048
    @jayantadutta6048 Рік тому

    Basics are getting stronger...

  • @ajaytormal2688
    @ajaytormal2688 3 роки тому

    thanks a lot, it was very helpful.

  • @sandeepkhatnoria2776
    @sandeepkhatnoria2776 5 років тому

    Uh re best teacher ... Kassh humre clg mei hotee

  • @RRR-fe7xo
    @RRR-fe7xo 5 років тому

    Great teaching sir

  • @nikitabhokare8
    @nikitabhokare8 3 роки тому +1

    Super

  • @redmangomore1996
    @redmangomore1996 3 роки тому

    Pure knowledge

  • @AshutoshMishra-pk2mo
    @AshutoshMishra-pk2mo 4 роки тому

    ase kirpa banaye rkhe gurudev

  • @LyricalCom-co9xj
    @LyricalCom-co9xj 3 роки тому

    Thank u very much sir u are great

  • @nirajsha5600
    @nirajsha5600 5 років тому

    U r great sir......😍

  • @subhadeepghosh2813
    @subhadeepghosh2813 7 років тому +1

    no one can compeat u. u r great

  • @krishnarajupadhyay4819
    @krishnarajupadhyay4819 5 років тому

    good way of explaining sirg.....Thank you very much.....agar isi ko macros use karke karna ho to kaise kare.....plz help...I am beginner in c & just subscribed you as your video is best among others I have found....

  • @mehaksharma9860
    @mehaksharma9860 6 років тому

    Awesome 🤗🤗🤗🤗thanku sir

  • @sumitrabesra4148
    @sumitrabesra4148 3 роки тому +1

    Thank u sir.......

  • @JackSparrow-tv3mo
    @JackSparrow-tv3mo 8 років тому +6

    hello sir, I am new to learn language & i am trying to learn from "let us c" book. but the theory given in book isn't sufficient for exercise problem. so, what can I do in this situation?

  • @aiyazhasnain3172
    @aiyazhasnain3172 5 років тому

    Sir u r simply amazing!!!

  • @mr.madhureditz3909
    @mr.madhureditz3909 3 роки тому

    Sir in this program (x=any variable) suppose is necessary b/c if I didn't suppose my program is not process

  • @anjaliprajapati7968
    @anjaliprajapati7968 4 роки тому

    Ek like to banta hai....😍😍😍

  • @ShubhamSharma-nr7kw
    @ShubhamSharma-nr7kw 3 роки тому

    Thanks sir ❤️🙏

  • @GreatstoriesHeard
    @GreatstoriesHeard 6 років тому

    i make this program today evrything was right but the when i enter the digits & press enter the sum didnt show???? help me out

  • @plazorekumar6199
    @plazorekumar6199 5 років тому +1

    You are great Sir ji.

  • @sonukoushal1004
    @sonukoushal1004 4 роки тому

    👍👍👍👍👍

  • @kamleshpatidar6331
    @kamleshpatidar6331 6 років тому +1

    Thanks sir ji

  • @shwetahegde8850
    @shwetahegde8850 3 роки тому

    👍👍

  • @Lalitojha_27
    @Lalitojha_27 6 років тому

    Sir its only for unary digits ...how to add binary and unary digits together

  • @Travel_brat
    @Travel_brat 6 років тому

    Sir how to calculate product of digits of a number with for loop.....its not working but woeking with while loop

  • @navdeepgautam5157
    @navdeepgautam5157 5 років тому

    Sir output me next line m kaise agya sum jabki humne to
    use hi ni kia khi pe bhi?

  • @IA-vm9ol
    @IA-vm9ol 4 роки тому

    Sir what is the statement written in the 5th line ....%d

  • @Shubham-us3nb
    @Shubham-us3nb Рік тому +1

    Thank you

  • @005lemdshahbazkhan2
    @005lemdshahbazkhan2 3 роки тому

    Without using loop bhi solve kr sakte h.. Kya

  • @Abhisheksharma-ve2yg
    @Abhisheksharma-ve2yg 3 роки тому

    adding one to each digit of a number in c programming??

  • @saadulhasnain4675
    @saadulhasnain4675 8 років тому +2

    mind blowing!

  • @sugar_fire6536
    @sugar_fire6536 4 роки тому

    Sir while me r agr likhetab BHI Shi jud rha h

  • @SatveerSingh-tw9gc
    @SatveerSingh-tw9gc 4 роки тому

    sirji jb mene 10 digit ka number enter kiya to usme nine digit ka answer aaya but mynus(-) mai aaya sirji please tell me how to solve it

  • @javedalam7080
    @javedalam7080 7 років тому +2

    thank you sir

  • @naveenbhardwaj933
    @naveenbhardwaj933 4 роки тому +1

    Sir when we type 123456 then it shows the sum is in negative .... But when i adding it to 1 to 5 ,it gives correct result.... Why it so happen, plz solve my question

    • @yashwardhan5052
      @yashwardhan5052 3 роки тому

      try once by online compiler
      my compiler is showing correct answer

  • @pritamb3328
    @pritamb3328 9 років тому +1

    great video sir! My question is how to print something(it may be a word or a sentence) without using any semicolon?????????

    • @pritamb3328
      @pritamb3328 9 років тому

      +Saurabh Shukla sir please give me the link

    • @kantidevi9774
      @kantidevi9774 7 років тому

      No it is not possible to print anything without semicolon

    • @kantidevi9774
      @kantidevi9774 7 років тому

      In q basic

  • @usmathsclasses5279
    @usmathsclasses5279 6 років тому

    Nice sir

  • @Mee-Mikey
    @Mee-Mikey 2 роки тому

    ThankYou Sir

  • @varuntewani2854
    @varuntewani2854 7 років тому +1

    sir for 10 digits it is showing right ANSWER but for more than 10 digits it is giving incorrect answer

    • @mranonymous7766
      @mranonymous7766 5 років тому

      use long int instead of int and %ld instead of %d

  • @sumitsharma7055
    @sumitsharma7055 7 років тому

    Sir Maine is program ko for loop se kra...... but sir input 1 dalne pr sum 14 dikha raha h...Kya galat h...sir...dekhna
    Int x,sum=0,s,i;
    Scanf("%d",&x);
    For(I=0;x!=0;I++)
    {
    S=s%10;
    Sum=sum+s;
    X=x/10;
    }
    Printf("%d",sum);

  • @shubhamshengar9870
    @shubhamshengar9870 3 роки тому

    Sir, agar hum 111111111111111 (15times 1) lete hai to ans 35 ata hai how

  • @pritilatakumbhakar6828
    @pritilatakumbhakar6828 5 років тому +1

    Ye programming 4 digit number k liye v appropriate hoga? Plz reply

    • @aiyazhasnain3172
      @aiyazhasnain3172 5 років тому

      This is a general program applicable for a no of any digits.

  • @surekhakumari5959
    @surekhakumari5959 8 років тому

    how to find that sum of squares of digit is equal to given number

  • @sridharbajpai420
    @sridharbajpai420 6 років тому +1

    sir make a programme to sum untill a single digit appear for ex=1245=1+2+4+5=12=1+2=3 so ans is 3

  • @strugglers3695
    @strugglers3695 8 років тому

    sir when i take more than 7 digits......the otput comes wrong....plzz elaborate it
    ...

    • @chirantanbhuyan174
      @chirantanbhuyan174 7 років тому

      The limitation of int type declaration is upto 5 numbers. So, if you would try to enter more, wrong output would be printed.
      GIGO !!!!
      Peace !!!

    • @ShubhamYadav-uz5ot
      @ShubhamYadav-uz5ot 7 років тому

      because the limitation of int type is 5

  •  4 роки тому

    ecxellent

  • @iramidrees7060
    @iramidrees7060 8 років тому +1

    Thankkyou :-)

  • @gauravthakur4208
    @gauravthakur4208 4 роки тому

    Sir for loop ke saath bhi btabdo plzzz

  • @aayushrajput8589
    @aayushrajput8589 6 років тому

    Sir when we enter zero then also answer is zero... Answer should be one

  • @sandipkamble8044
    @sandipkamble8044 3 роки тому

    Sir 203 ka sum kese Aata Japki x! =0 he to?

  • @cptninja7890
    @cptninja7890 7 років тому

    Sir kya app mujhe baata sakte hai,ki agr ham ek 4 ya 5 digit number le,to ham uska sirf 1st or last digit ka sum kase kare🙏🙏🙏🙏🙏

    • @sush9889
      @sush9889 7 років тому

      i also want its solution

  • @navdeepgautam5157
    @navdeepgautam5157 5 років тому

    Thanks so much

  • @AliSays786
    @AliSays786 5 років тому

    Thank... U sir❤️

  • @aryanraj6304
    @aryanraj6304 4 роки тому +1

    Is there any other way to do this?

  • @Sachinkanawade1
    @Sachinkanawade1 7 років тому

    accept "only" three digit number from user ??? plzz sir explain who to do this ??????

  • @JL-pg4pj
    @JL-pg4pj 5 років тому

    if the given number is 100000000000000000000000000000 then how can get the sum of digits?

  • @balarambhakta6397
    @balarambhakta6397 5 років тому

    sir i need to know one answer immediately plzz
    for(i=1;i

  • @Travel_brat
    @Travel_brat 6 років тому +1

    Dear sir....this programme is not also working for more than 4 digits...plz help me out

    • @Chandan-xz8cd
      @Chandan-xz8cd 6 років тому

      kyu ki bahi ek int zaada badi vallue nahi leta ha ek integer varietal :> 65535 ke zitni vallue he lega

    • @Chandan-xz8cd
      @Chandan-xz8cd 6 років тому +1

      agar zaada badi vallue enter karwani ha to ( long int ) deta type ko use kro zaha par aap %d likhte ho wha par %li (LONG INT) likhna ok..................

    • @noobiegamer2407
      @noobiegamer2407 6 років тому

      Try this code:
      #include
      int main()
      {
      float a,s=0,r;
      printf("Eneter the digit of your choice:");
      scanf("%f",&a);
      while(a!=0)
      {
      r=a%10;
      s=s+r;
      a=a/10;
      }
      printf("The sum of the digits is = %f",s);
      return 0;
      }

  • @rashijain3762
    @rashijain3762 8 років тому

    Sir if entered more than 5 or 6 number the sum is wrong... Plz solve this

    • @chirantanbhuyan174
      @chirantanbhuyan174 7 років тому

      The limitation of int type declaration is upto 5 numbers. So, if you would try to enter more, wrong output would be printed.
      GIGO !!!!
      Peace !!!

    • @Chandan-xz8cd
      @Chandan-xz8cd 6 років тому

      agar zaada badi vallue enter karwani ha to ( long int ) deta type ko use kro zaha par aap %d likhte ho wha par %li (LONG INT) likhna ok.........kyuki ek integer variable :> 65535 tak he vallue leta ha

  • @telangananewsadda
    @telangananewsadda 6 років тому

    Call by pointer by adding two numbers

  • @susumyadavyou5301
    @susumyadavyou5301 6 років тому +1

    thank u......🙏🙏🙏🙏

  • @rupaliyenage3934
    @rupaliyenage3934 8 років тому +2

    Sir can u please upload program to print "N" line of file
    please sir

  • @abhikaushik3052
    @abhikaushik3052 7 років тому

    Sir, how to print sum of digits but according that format.
    Enter a number : 1456
    Output : [1+4+5+6] = 16

    • @mysirgdotcom
      @mysirgdotcom  7 років тому +1

      If I tell you the solution, you will not learn "Thinking like a programmer" and eventually, struggle later.
      Think how can you break this number as a digit. Try it.

    • @abhikaushik3052
      @abhikaushik3052 7 років тому

      Thank u sir for reply. Yes sir u right I totally admit it. Now., i remember it throughout my programming.
      I Can n i will make it.

    • @abhikaushik3052
      @abhikaushik3052 7 років тому

      It's done.

    • @ritavyas644
      @ritavyas644 4 роки тому

      @@abhikaushik3052 Can you show me coding of this program.
      Enter a number : 1456
      Output : [1+4+5+6] = 16

    • @abhikaushik3052
      @abhikaushik3052 4 роки тому

      @@ritavyas644 sorry but it's a long time ago.🙂
      For now on your own.

  • @subratkumaracharya7356
    @subratkumaracharya7356 3 роки тому

    Sir can I attend ur physical clasd

  • @sujatakumarisujatakumari6774
    @sujatakumarisujatakumari6774 3 роки тому

    Write a program to take inputany four numbers and print the sum

  • @sibanandaroutray7934
    @sibanandaroutray7934 4 роки тому

    🙏🙏🙏🙏🙏🏾🙏🏽

  • @anufugi4639
    @anufugi4639 4 роки тому

    5 digits add nhi ho pa rhe he

  • @avishekkumar9336
    @avishekkumar9336 7 років тому

    plz make a video on c programming where input will b like this
    input=x4y7
    and output will be like
    output=xxxxyyyyyyy

    • @Chandan-xz8cd
      @Chandan-xz8cd 6 років тому +2

      /*
      your Solution
      plz make a video on c programming where input will b like this
      input=x4y7
      and output will be like
      output=xxxxyyyyyyy
      */
      void main(){
      int x,y;
      int a;
      clrscr();
      printf("Enter Two Numbers X And Y = ");
      scanf("%d%d",&x,&y);
      for(a=0;a

  • @mahajanujjwalkisan9464
    @mahajanujjwalkisan9464 6 років тому +2

    Make a video smaller than this it will give speed up

  • @abdullahansari5084
    @abdullahansari5084 5 років тому

    There may be an error if u have single digit

  • @yking9889
    @yking9889 5 років тому

    Sir for loop se bata doo