(1 mark, file to be edited: Q6.c)
Your program allows the user to enter a string and a character to search for all occurrences in this string.
The program prints the new string after replacing the found character with the character 'X'. If the character is not found, print: "Character 'c' not found".
Here is an example of how the program will run:
case 1
case 2
Hello World
1
Hello World
OUTPUT:
OUTPUT:
HeXXo WorXd
Character 'A' not found Press any key to continue
Press any key to continue
Question 7:
(1 mark, file to be edited: Q7.c)
The program allows the user to enter the values of the elements of the square matrix as integers with the same number of rows and columns and input from the keyboard.
Print the element with the maximum value on the main diagonal of the matrix.
Below is an example:
Enter 'rows' = 3; array = [
5 18 4
Zoom
+ 93%
Close