Write a c program to accept a number and display addition of digits to the number
Answers
Answered by
0
Answer:
Sum of digits of a number in C
int main() { int n, t, sum = 0, remainder;
printf("Enter an integer\n"); scanf("%d", &n);
t = n;
while (t != 0) { remainder = t % 10; sum = sum + remainder; t = t / 10; }
printf("Sum of digits of %d = %d\n", n, sum);
return 0; }
Answered by
0
Answer:
1. State whether true or false:
(a) Harishena composed a prashasti in praise of
Gautamiputra Shri Satakarni.
(b) The rulers of Aryavarta brought tribute for
Samudragupta.
(c) There were twelve rulers in Dakshinapatha.
Similar questions