I: 52013
O: Invrse : 31025
O: Sum : 11
-------------------------------
#include<'stdio.h'>
main()
{
long numb, rem, i, sum=0;
printf("Input a 5 digit number : ");
scanf("%ld",&numb);
i = 1;
printf("inverse is ");
while(i<=5)
{
rem=numb%10;
numb=numb/10;
printf("%ld",rem);
i++;
sum = sum + rem;
rem=0;
}
printf("\n sum is %ld",sum);
}
No comments:
Post a Comment