answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int i=0,,res=0;

int num,ar[5];

printf("\nEnter the number.\n");

scanf("%d",&num);

while(num>0)

{

ar[i]=num%10;

num/=10;

i++;

}

i--;

while(i>=0)

res=res+ar[i];

printf("Result is %d",res);

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How can you generate a palindrome from a given number?

You write the number and then follow it with the digits in reverse order.


Write a pseudo code to find the sum of digits of a given number reducing them to a single digit?

5


How write a program to input any number and display digits which are absent in given number?

To write a program that inputs a number and displays the digits absent in it, you can follow these steps: Convert the input number into a set of its digits. Create a set of all possible digits (0-9). Subtract the set of digits from the complete set to find the missing ones. Display the missing digits. Here’s a simple example in Python: number = input(&quot;Enter a number: &quot;) present_digits = set(number) all_digits = set('0123456789') missing_digits = all_digits - present_digits print(&quot;Missing digits:&quot;, ''.join(missing_digits))


How many significant digits are in for this number 3.008?

All four of the digits given are significant digits.


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Include zeros in 2.25 million?

Million is the name given to a number with 7 digits in front of the decimal place. In order to write out any number take the number you are given and and move the decimal place to the right until you have 7 digits in front of the decimal. add zeros to the end until it has 7 digits in front of the decimal place. So 2.25 million would be 2,250,000.


If a number with two digits is equal to four times the sum of its digits the number formed by reversing the order of the digits is 27 greater than the given number what is the number?

36


What is the smallest 5 digits odd number that can be formed with given digits 45083?

03458


Is a number with two digits is equal to four times the sum of its digits the number formed by reversing the order ofthe digits is 27 greater than the given number what is the number?

The number is 36.


The sum of the digits of a two digit number is 9 the number obtained by reversing the order of the digits of the gven numbers exceeds the given number by 27 find the given numbers?

3 and 6


Is the factor of the sum of digits equals 9 or a multiple of 9?

If the sum of the digits of a given number equals nine or a multiple of nine, nine is a factor of that number.


How many significant figures are in 4.12?

There are three significant digits in the given number.