×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Binary Searching using C - MAKAUT / WBUT MCA 2011 Write a c Programming to create a binary pyramid. - MAKAUT / WBUT MCA 2012
Sum of its Individual Digits Repeatedly - MAKAUT / WBUT MCA 2011 - C Language
1861    Arnab De    18/12/2019

Write a program to accept a number and find sum of its individual digits repeatedly till the result is a single digit. [MAKAUT / WBUT MCA 2011]

Here we use two loop, one for sum the digits and another one use for checkthat sum result.

softetechnologies
#include <stdio.h>
int main()
{
    int no,s=10;
    printf("Enter A No : ");
    scanf("%d",&no);
    while(s>9)
    {
        s=0;
        while(no>0)
        {
            s += no%10;
            no /= 10;
        }
        no=s;
    }
    printf("One Digit Sum is %d",s);
}
softetechnologies

Output :

Enter A No :2345
One Digit Sum is 5

Binary Searching using C - MAKAUT / WBUT MCA 2011 Write a c Programming to create a binary pyramid. - MAKAUT / WBUT MCA 2012
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Sri Sri Ramakrishna Paramahamsa
The supreme purpose and goal for human life... is to cultivate love.
Sri Sri Ramakrishna Paramahamsa
1371
71.21
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     51703
25/06/2018     43587
01/01/2018     42725
28/06/2017     40448
02/08/2017     39251
01/08/2017     33496
06/07/2017     33217
15/05/2017     32611
14/07/2017     28814
11/09/2018     28571
softetechnologies