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;
Answer:
Healthy plant growth follows from sufficient water.
Contrapositive: If water is insufficient, then there isn't healthy plant growth
Increased availability of information is a necessary condition for further technological advances
Contrapositive: Absence of further technological advances implies decreased availability of information.
Errors were introduced only if there was a modification of the program.
Contrapositive: If there wasn't any modification of the program then error was not introduced into the program
Fuel savings implies good insulation or storm windows throughout.
Contrapositive: The absence of good insulation or storm windows throughout implies that there is no fuel savings.
Explanation:
A contrapositive statement is formed from a conditional statement as we can see from the answers above.
In a contrapositive statement, we just interchange the hypothesis and the conclusion of the inverse statement.
This implies that, when the converse of the statement is true, then the inverse of the statement is also logically true.
Answer:
hope this helps if not srry
Placing it on top then sliding the dile to close it, can you give me brainlist??