Write a program where the user will give input 20 times. If the inputs are capital or small letters, it will print out those. Moreover, if the inputs are digits, it will calculate the sum of them. All other inputs will be discarded. [please solve the problem without array] Example output: Enter input 20 times: Enter input 1: A Enter input 2: B Enter input 3: C Enter input 4: x Enter input 5: p Enter input 6: 5 Enter input 7:9 Enter input 8: @ Enter input 9:# Enter input 10:* Enter input 11: p Enter input 12: Q Enter input 13: N Enter input 14:4 Enter input 15: 8 Enter input 16: X Enter input 17: $ Enter input 18: G Enter input 19: 1 Enter Input 20: 3 Capital letter and small letters are: ABcxpPONXGL Sum= 29
Please find the output like example which is given below and solve the problem without array.
Write a program where the user will give input 20 times. If the inputs are capital or small
letters, it will print out those. Moreover, if the inputs are digits, it will calculate the sum of
them. All other inputs will be discarded. [please solve the problem without array]
Example output:
Enter input 20 times:
Enter input 1: A
Enter input 2: B
Enter input 3: C
Enter input 4: x
Enter input 5: p
Enter input 6: 5
Enter input 7:9
Enter input 8: @
Enter input 9:#
Enter input 10:*
Enter input 11: p
Enter input 12: Q
Enter input 13: N
Enter input 14:4
Enter input 15: 8
Enter input 16: X
Enter input 17: $
Enter input 18: G
Enter input 19: 1
Enter Input 20: 3
Capital letter and small letters are: ABcxpPONXGL
Sum= 29
Step by step
Solved in 3 steps with 1 images