Skip to content

adding individual digits of a number

  1. Home>
  2. adding individual digits of a number

Program to add individual digits of a number

  • Post author:admin
  • Post published:July 30, 2018
  • Post category:C Programms
  • Post comments:0 Comments

#include<stdio.h> #include<conio.h> void main() { long int a,n,sum=0; clrscr(); printf("enter any number"); scanf("%lld",&n); while(n>0) { a=n%10;    // storing the remainder sum=sum+a; n=n/10; } printf("%lld",sum); getch(); } Output:

Continue ReadingProgram to add individual digits of a number

Recent Posts

  • Hello world!
  • How to publish the first blog post | Get Indexed | Google
  • 8 Ways to make money through blogging|Passive Income
  • Build a strong blogging brand | Best tips for blogging
  • Add Facebook page plugin to the blog

Recent Comments

  1. A WordPress Commenter on Hello world!
Copyright [oceanwp_date] - Design by Unique Ratlam Ajanta Talkies Road

WhatsApp us