Horje
Frequency Code Example
Frequency
printf("Enter n: ");
  scanf("%d", &n);
  
  int elem[n];
  
  printf("Enter elements: \n");
  
  for(x=0; x<n; x++){
  
  scanf("%d", &elem[x]);
  }
  
  int y;
  
  printf("Enter y: ");
  scanf("%d",&y);
  
  for(z=0; z<n; z++){
  
  		if(elem[z]==y){
  			count++;
		  }
  
  }
      printf("FREQUENCY: %d",count);
frequency
#take user input
String = input('Enter the string :')
#take character input
Character = input('Enter character :')
#initiaalize int variable to store frequency
frequency = 0
#use count function to count frequency of character
frequency = String.count(Character)
#count function is case sencetive 
#so it print frequency of Character according to given Character
print(str(frequency) + ' is the frequency of given character')




C

Related
command line arguments c Code Example command line arguments c Code Example
refresh a chromebook terminal Code Example refresh a chromebook terminal Code Example
check if the c code is a palindrome Code Example check if the c code is a palindrome Code Example
input value from terminal to c Code Example input value from terminal to c Code Example
Mongo connect db Code Example Mongo connect db Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9