Computer Science, asked by yugantar4197, 10 months ago

Write a c program to find the sum of digits in given integer using do while loop

Answers

Answered by mauryapriya221
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