#include
int main()
{
int num, dig, sum = 0; /* be sure to initialize sum to 0 */
printf("Enter number:");
scanf("%d", &num); /* num is our actual number */
while (num > 0) /* While we still have digits in num */
{
dig = num % 10; /* Get the rightmost digit in num... */
sum += dig; /* and add it to sum */
num = num / 10; /* Get rid of the rightmost digit in num */
}
printf("Result: %d", sum);
return 0;
}
first read nd write all individual digits then goto sum funtion use by adding all individual digits..
With repeated multiplication.
no thanks
Computer programmers use an array to arrange digits of a number in ascending order. The program uses character array to store the digits and a quick sort feature to sort them.
lol no betch
Algorithm and Flowcharts for a program to compute the sum of the squares of the numbers for a given range used for loop
nr\m;laeoh9y0m g.qthnedxc In fortran: do i=1,5 write(6,*)i enddo stop end This program will write the numbers 1 to 5 on the screen.
Write a c program to compute the surface area and volume of a cube
{A program to compute the area of a triangle} {by Ogboin W. Meshach} Var; b,h:real; BEGIN Writeln('Triangle'); Write('Base: '); Readln(base); Write('Height: '); Readln(height); area:=0.5*base*height; Writeln('Area: ', area :0:2); End.
. Write the paschal program to compute the area and circumference of the circle while radius(r) is entered by the user
import java.Scanner; nagado la amom} }}
there is no solution of this problem...........that's it..........