Online Examination System for all learner!!! coming soon..

C : Program to calculate the sum digits of a number.

Code:

#include<stdio.h>
#include<conio.h>
main()
{
        int x,n;
        printf("Enter a number :");
        scanf("%d",&n);
        x=sum_digit(n);
        printf("%d",x);
}
int sum_digit(int n)
{
        int s=0;
        while(n>0)
        {
                s=s + n%10;
                n=n/10;
        }
        return s;
}

Output:

C Programming Online Test 1

Following quiz provides Multiple Choice Questions (MCQs) related to C Programming Framework. You will have to read all the given answ...