Question: Write the C code for a number between 1-6 digits that the user will enter from the keyboard, adds the number belonging to each digit
Write the C code for a number between 1-6 digits that the user will enter from the keyboard, adds the number belonging to each digit of this number and if the result is double obtains a total result and continues the program; if it is odd, ends the program in the relevant place.
**Assume that you have to write a number which is consisted from 4 digits as 1234. (You must write this code according to the 1 to 6 digits-all of the options- which the user will enter.) The first thing is finding all digits separately and saving differently in C program. Then, you have to add all the digits and if the total is even the program has to be continued to another input. In contrast, the total is odd, the program has to be ended in that region.
***
For example: If your written value is 1234, the total is 1+2+3+4=10 and according to the even odd mathematical theory; 10 is even (you must write this even/odd code in C program) and the program has to be continued to another input entrance. If the value was odd, the program would be aborted ultimately.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
