© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

CPP Program To Find Percentage Of Given Numbers
#include #include void main() { clrscr(); int a[10],n,i,j; int percent; int count; cout<<"Enter the size of array\n"; cin>>n; cout<<"\nEnter the values\n"; for(i=0;i<=n-1;i++) { cout<<"\na["<>a[i]; } for( i=0;i<=n-1;i++) { count=0; for(j=0;j<=n-1;j++) { if(a[i]>a[j]) { count=count+1; } } percent=(count*100)/(n-1); cout<<"\nthe percentile of"<<"a["<

Sample Output :

Enter the size of array
5

Enter the values

a[0]=10

a[1]=20

a[2]=50

a[3]=80

a[4]=95

the percentile ofa[0]0
the percentile ofa[1]25
the percentile ofa[2]50
the percentile ofa[3]75
the percentile ofa[4]100

 
SLogix Student Projects
bottom