Skip to content

Instantly share code, notes, and snippets.

@rizwansoaib
Created January 4, 2018 11:08
Show Gist options
  • Save rizwansoaib/072d67ba2030941ce05a245d530135c2 to your computer and use it in GitHub Desktop.
Save rizwansoaib/072d67ba2030941ce05a245d530135c2 to your computer and use it in GitHub Desktop.
For sum of 5 digit
#include <stdio.h>
void main()
{
int x;
printf("please enter 5 digit to know sum");
scanf("%d",&x);
int a=x%10;
int u=x/10;
int b=u%10;
int v=u/10;
int c=v%10;
int w=v/10;
int d=w%10;
int y=w/10;
int e=y%10;
int ans=a+b+c+d+e;
printf("%d",ans);
}
@rizwansoaib
Copy link
Author

For sum of 5 digit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment