Skip to main content
Search
Search This Blog
Livecodo
Pages
Home
Courses
Blog
About us
More…
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
March 28, 2024
Write a C program to find the sum of individual digits of a positive integer.
#include
#include
int main() { int n,sum=0; printf("enter the +ve no.",n); scanf("%d",&n); while(n>0) { sum=sum+n%10; n=n/10; } printf("Sum of individual integer is %d",sum); return 0; }
Popular Posts
March 26, 2024
Dynamic Memory allocation in C
May 18, 2024
Searching and sorting Algorithm in C