Answer:
#include <stdio.h>
#include <string.h>
int main(){
char number[100];
printf("Number: ");
scanf("%s", number);
int sum = 0;
for(int i =0;i<strlen(number);i++){
sum+= number[i] - '0';
}
printf("Sum: %d",sum);
return 0;
}
Explanation:
This declares a c string of 100 characters
char number[100];
This prompts user for input
printf("Number: ");
This gets user input
scanf("%s", number);
This initializes sum to 0
int sum = 0;
This iterates through the input string
for(int i =0;i<strlen(number);i++){
This adds individual digits
sum+= number[i] - '0';
}
This prints the calculated sum
printf("Sum: %d",sum);
return 0;
1, 3
---------------------------------------------------
if you follow me and like and mark in brainliest answer only I will tell the answer
Answer:
Check button under error checking
Explanation:
Under the Tools tab there are two options:
Error checking and Optimize and defragment drive option.
clicking the check button with administrative permission under error checking option will examine the hard drive for errors.
An application where you would prefer a parallel circuit over series would be a string of Christmas lights. If the light string is wired in parallel, when one bulb burns out, it would not effect the red of the string.