SHARE
TWEET

Untitled

a guest Feb 14th, 2020 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. void cnt(int ar[],int n)
  3. {
  4.     int br[10];
  5.     int j=0;
  6.     for(int i=0;i<n;i++)
  7.     {
  8.         br[ar[i]]=br[ar[i]]+1;
  9.     }
  10.  
  11.     for(int i=0;i<7;i++)
  12.     {
  13.         for(j=1;j<=br[i];j++)
  14.         {
  15.             printf("%d ",i);
  16.         }
  17.     }
  18.  
  19. }
  20.  
  21. int main()
  22. {
  23.     int ar[]={2,2,1,5,6,1,5,2};
  24.     int n=7;
  25.     cnt(ar,n);
  26.  
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top