Skip to content

Sum of digits of a number#1

Open
akashnagpal1123 wants to merge 65 commits into1406-maker:masterfrom
HelloWorldGTBIT:master
Open

Sum of digits of a number#1
akashnagpal1123 wants to merge 65 commits into1406-maker:masterfrom
HelloWorldGTBIT:master

Conversation

@akashnagpal1123
Copy link

#include<conio.h>
#include<stdio.h>
int main()
{
int n , t sum=0,rem;
printf("Enter the number of whose sum you want: ");
scanf("%d ",&n);
t=n;
while(t !=0)
{
rem=t%10;
sum=sum+rem;
t=t/10;
}
printf ("The sum of digits of %d = %d \n ",n,sum);
return 0;
}

iamchiragsharma and others added 30 commits October 11, 2019 12:50
hi hello
print statement used
print statement used
This program code prints the factorial of a number using recursion in C language.
This program code prints the factorial of a number using recursion in C language.
count the alphabets and numbers
sum of two numbers
This program finds the sum of digits of a number entered by the user in C lang.
siddharthnarula and others added 30 commits October 12, 2019 15:03
Rename sum of numbers to sum of numbers.cpp
Create multiplicationofnumbers.cpp
This program swaps 2 elements using  call by reference method in C language
Swapping Of elements using Call by reference
prubhtej upload request 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants