//Downloaded From www.c4cpp.co.nr  
 //(C)2009.All rights reserved.  
 #include<iostream.h>  
 #include<conio.h>  
 #include<string.h>  
 void main()  
 {  
 clrscr();  
 int i,j,c=1,l;  
 char a[100];  
 cout<<"Enter Array"<<endl;  
 cin.getline(a,100);  
 l=strlen(a);  
 for(i=0;i<l;i++)  
 {  
 c=1;  
 for(j=i+1;j<l;j++)  
 {  
 if(a[i]==a[j])  
 {  
 c=c+1;  
 a[j]=' ';  
 }  
 }  
 if(a[i]!=' ')  
 cout<<"Element"<<a[i]<<"is present"<<c<<"times"<<endl;  
 }  
 getch();  
 }  
Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]
No. of repetitions of a digit
Click Here To Download C++ File Of This Program
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment