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
Science,
7 months ago
Hindi,
7 months ago
Physics,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Biology,
1 year ago
Geography,
1 year ago