Advertisement
Mahfuz123

digit

Oct 14th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int n,ara[100], i = 0,count = 0,a;
  6.  
  7. printf("Enter a number : ");
  8. scanf("%d", &n);
  9.  
  10. while(n!=0)
  11. {
  12. a = n%10;
  13. ara[i] = a;
  14. n/=10;
  15. i++;
  16. count++;
  17. }
  18. for(i=count-1; i>=0; i--)
  19. {
  20. printf("%d ", ara[i]);
  21. }
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement