×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Find GCD and LCM of two positive integer - MAKAUT / WBUT MCA Slove Dynamic Memory Allocation malloc vs calloc -MAKAUT / WBUT MCA 2011
Sum of its Individual Digit Until Single Digits - MAKAUT / WBUT MCA 2011 - C Language
490    Arnab De    18/11/2019

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

softetechnologies
#include <stdio.h>
int main()
{
    int no,i,sum;
    printf("Enter A Number : ");
    scanf("%d",&no);
    do{
        sum=0;
        while(no>0)
        {
            sum += no%10;
            no = no/10;
        }
        no=sum;
    }while(sum>9);
    printf("One Digit Sum is %d",sum);
}
softetechnologies
Find GCD and LCM of two positive integer - MAKAUT / WBUT MCA Slove Dynamic Memory Allocation malloc vs calloc -MAKAUT / WBUT MCA 2011
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
If you want to go east, don't go west.
Sri Sri Ramakrishna Paramahamsa
2474
32.45
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     33208
28/06/2017     29018
02/08/2017     26445
26/05/2018     25948
15/05/2017     22743
06/07/2017     21167
01/08/2017     20872
21/04/2018     18372
25/06/2018     17110
14/07/2017     15996
softetechnologies