answersLogoWhite

0


Best Answer

"in order to check the repetition of characters in a string in c" we have to pick up each element of the string using a for loop and then using its ASCII value check whether another character of the same ASCII value exists using an if condition statement.

User Avatar

Wiki User

17y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

boolean isRepeat(char *s)

{

int i,j;

for(i=0;s[i]!='\0';i++)

{

for(j=i+1;s[i]!='\0';j++)

{

if(s[i]==s[j])

return 1;

}

}

return 0;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a C program to find repetitions of letters in a string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to implement the various operations on string such as length of string concatenation reverse of a string copy of a string to another in VB?

what is string


Write a program in java to display a string message using Servlets?

i dont no string for servlate


Write the program in Linux to find the reverse of any string?

i am sam


Write a program to find the length of a string in shellscript?

This is an assignment not a question.


How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


Write a java program to count the space from the given line?

.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))


What is An application program that is used to write letters and type papers?

Word Processing is used to write letters and type papers.


How would you write this in Python Assume that word is a string for example slice Write a code to print out the following pattern s sl sli slic slice?

>>> string = 'slice' >>> letters = list(string) >>> print letters ['s', 'l', 'i', 'c', 'e'] >>> string2 = '' >>> for letter in letters: string2 += letter print string2 s sl sli slic slice


Write a program convert a string from uppercase to lower case and vice-versa without using string tolower and string toupper commands in TCL?

[ string toupper $str ] or [ string tolower $str ]


Do I need to write a program to find a substring in a given string in c plus plus?

No.


Write a c program to print roman letters?

good morning