hi, every body..
I have two program I couldn’t solve them
So, can any body help me. please!!
1-Write a program that accepts a character and count number of occurrences in a file.
The file should have some text, and the program count how many times the inputted character repeated in the file and prints the result on the screen.
(Hint: you have to use continue statement in your solution )
Sample input:
Input.txt
I am a student in the university
Sample output:
Enter the character :a
The letter a repeated 2 times(s)
2-Write a program that accepts a character and search it in a file.
The file should have some text, and the program search for the first occurrence of the character and print it’s location on the screen…
(Hint: use break statement to stop the loop)
Sample input:
Input.txt
I am a student in the university
Sample output:
Enter the character to search :a
the first occurrence of a character is at location 3
I am waiting the replies ..
{ thanks all}