.C Program to Find the Number of Integers Divisible by 5 in a given range:
C Program to Compute the Sum of Digits in a given Integer:
This is a C program to compute the sum of digits in a given integer.
Problem Description
This program computes the sum of digits in a given integer.
Problem Solution
Take the integer as input.
Divide the input integer by 10, obtain its remainder and quotient.
Increment the new variable with the remainder got at step 2.
Repeat the step 2 & 3 with the quotient obtained until the quotient becomes zero.
Print the output and exit.
Program/Source Code
/*
* C program to accept an integer & find the sum of its digits
*/
#include
void main() Show More
All Chapters — C programming
Similar Questions
From C Programs on integers · C programming
C Program to Check if a given Integer is Odd or Even:
C Program to Accept two Integers and Check if they are Equal:
C Program to Check if a given Integer is Positive or Negative:
C Program to Read Two Integers M and N & Swap their Values:
C Program to Calculate the Sum of Odd & Even Numbers: