Advertisement
saira12tabassum19

Untitled

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