My addition program doesn't work correctly.
Code:
int main()
{
int total_value=0;
char mynum;
do
{
printf("Line: ");
scanf("%c",&mynum);
mynum+=total_value;
} while(mynum!='.');
printf("Total values are: %d,mynum);
Basically i want the user to enter a word/sentence and from there i will store all the character they enter until they enter a period. If they enter ABC followed by a period. Then i add up all the values (ASCII) including the period.
As of right now, my program only works if the user enters a period, as it'll jump straight to the printf function outside of the loop. And print out "46"
Whats wrong?