daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Sep 24th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int size=0;
  6. int*x;
  7. int max=0;
  8. int value;
  9. x=new int [size];
  10. for(int i=0;i<size;i++){
  11.       x[i]=0;
  12.       }
  13. cout<<"Enter the grade of student"<<endl;
  14. do{
  15.     cin>>value;
  16.     if(value>max)
  17.         max=value;
  18.     if(value>=0)
  19.         x[value]++'
  20.         }while(value !=-1);
  21.         for(int j=0;j<=max;j++)
  22.            cout<<j<<x[j]<<endl;
  23.            
  24. }
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