Write a c program to find the sum of digits in given integer using do while loop
Answers
Answered by
6
Answer:
Sum of Natural Numbers Using while Loop
#include <stdio.h>
int n, i, sum = 0;
printf("Enter a positive integer: ");
scanf("%d", &n);
i = 1;
while (i <= n) {
sum += i;
++i;
Plz mark as brainliest
Similar questions
English,
5 months ago
Social Sciences,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Computer Science,
10 months ago
Biology,
1 year ago
Geography,
1 year ago