write a program to input a number consisting of 3 digits and find the sum of the digits
Answers
Answered by
0
Answer:
When you read the user input, you read it as one number:
printf("enter four digit integer:\n");
scanf("%d", &digit1,&digit2,&digit3,&digit4);
should be:
printf("enter four digit integer:\n");
scanf("%d", &number);
Next you need to extract the individual digits from the number read, using the % and / operators and finally add them.
I think it will help you
make me brainlist
Similar questions