Code:
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <conio.h>
void main()
{
unsigned int n,m,oddSum=0,evenSum=0;
char ch
printf("Please insert the number for the program:");
scanf("%d",&n);
printf("Press 1 for qu. 1:\n");
printf("Press E or e to exit:\n");
ch=getchar();
switch ( ch )
{
case '1':
while (n!=0) {
oddSum += n % 10;
n /= 10;
evenSum += n % 10;
n /=10;
}
printf("Sum of digits in even places:\n",evenSum);
printf("Sum of digits in odd places:\n",oddSum);
printf("Difference:\n",evenSum-oddSum);
break;
default:
puts("Wrong choice!");
}
}