answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int num,num_save;

int ar[5],i=0,res_e=0,res_o=0;

printf("\nEnter the number : ");

scanf("%d",&num);

num_save=num;

while(num_save>0)

{

ar[i]=num_save%10;

num_save/=10;

i++;

}

i--;

while(i>=0)

{

if(ar[i]%2==0)

res_e=res_e+ar[i];

else

res_o=res_o+ar[i];

}

printf("\nNumber is %d\n",num);

printf("\nSum of even digits is %d",sum_e);

printf("\nSum of odd digits is %d",sum_o);

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

8086 assembly language that accepts two input digits?

In 8086 assembly language, you can accept two input digits by using interrupts to read from the keyboard. You would typically use the INT 21h service with function 01h to read a character, storing each digit in a register or memory location. After reading both digits, you can convert them from ASCII to their numeric values by subtracting 30h from each character. This allows you to perform arithmetic operations on the input digits as needed.


How can you write an algorithm for getting autoformic numbers?

Perhaps you mean an automorphic number? Loop through a series of numbers - for example, all numbers from 1 to 10,000 - and check each of the numbers, whether the condition applies. The condition in this case is that if you square the number, the last digits represent the original number.


How a check digit is calculated?

Check digits are determined (or derived) by a set algorithm using the digits of the account number.


How many strings of three the same digits have exactly three digits that are 9s?

Only 1 exists, and it is "999"


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))

Related Questions

How many digits did Fabrice Bellard calculate in 2009?

more that 50 digits.


How do you make the copyright symbol on the computer?

Press Alt key in the keyboard and press the digits 0,1,6,9


How can you calculate leap year?

divid the last to digits by 4


How many digits of pi did William shanks calculate?

707


Which brothers built a homemade supercomputer to calculate the digits of Pi?

computer


How many sequences of 6 digits can you form given the condition that no two adjacent digits have the same parity?

2 x 56.


What is a spook number-?

8161 is a Spook Number. It is made up of digits that are not 0s. All the digits separately add up to give double the first digit. 8+1+6+1=16 2x8=16


Who is responsible for finding how many digits are in pi?

Nobody is responsible. Different groups have decided, on their own, to calculate pi to many digits - as a sort of challenge.


How many digits in pi can computers now calculate?

5,983,948,393,122,123,098 nahson.com for more information


How to calculate the value of pi from the infinite series?

There are several infinite series. To find PI to x digits, evaluate each term to x+2 digits until the value is 0. Then round to x digits.


What is the the square root of 5?

The square root of 5 is approximately 2.236. It is an irrational number meaning we can not calculate its value no matter how many digits we can find. At one point a NASA computer was used to calculate the first million digits of the number.


What do you call a person with more than five fingers?

The individual is a "polydactyl ". The condition is "polydactyly" or "polydactylism", a congenital anomaly. The extra digits are referred to as "supernumerary digits".