saloni seth
Print sum of digits.
By saloni seth in C, C++, MFC on May 09 2012
  • Mukesh Kumar
    Sep, 2017 2

    Snippet like this t=0; b=a%10; a=a/10; t=t b;

    • 1
  • chaitanya pathak
    Jan, 2016 14

    #include #include void main() { int num=0; int sum=0; int reminder=0;clrscr(); printf("\n enter No to calculate sum of dgit"); scanf("%d",&num) while(num>0) {reminder=num%10; sum=sum+reminder; num=num/10; } printf("Sum of digit=%d",sum) getch();}

    • 1
  • Rahul Prajapat
    May, 2015 31

    while(num){ r=num%10; num=num/10; sum=sum+r; }

    • 1
  • Sanjay Singh
    Apr, 2014 28

    while(num){r=num%10;num=num/10;sum=sum+r;}

    • 1

Most Popular Job Functions


MOST LIKED QUESTIONS