“La fréquence” Réponses codées

la fréquence

#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')
sree_007

La fréquence

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);
Amauna

Réponses similaires à “La fréquence”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code