Program Plan:
Define Header files.
Define main()function
Declare local variables and assigning values to variables.
Checking the condition using while()loop.
Declare array variable str.
Asking user to enter string.
Checking the condition using for() loop till the iteration i is equal or less than 49.
Storing index with array string num.
Doing modulus with num value.
Storing num value with final_val variable
Displaying the value of final_val.
Return successfully to main().