Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,temp,i;
- printf("Input number:");
- scanf("%d",&n);
- int count[10]={0,0,0,0,0,0,0,0,0,0};
- while(n!=0)
- {
- temp=n%10;
- for(i=0; i<10; i++)
- {
- if(temp==i)
- {
- count[i]++;
- }
- }
- n=n/10;
- }
- for(i=0;i<10;i++)
- {
- printf("Frequency of %d = %d\n",i,count[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement