Answer Posted / deepak upadhyay
#include<stdio.h>
void main()
{
int num,a,b,c,d,e,sum;
printf("enter the num");
scanf("%d",&num);
a=num%10;
b=((num%100)-a)/10;
c=((num%1000)-(num%100))/100;
d=((num%10000)-(num%1000))/1000;
e=((num%100000)-(num%10000))/10000;
sum=a+b+c+d+e;
printf("\n1's place= %d \n10's place= %d \n100's
place= %d \n1000's place= %d \n10000's place=
%d",a,b,c,d,e);
printf("\nsum=%d",sum);
}
| Is This Answer Correct ? | 1 Yes | 6 No |
Post New Answer View All Answers
What are the advantages of the functions?
Write a program for finding factorial of a number.
Is fortran faster than c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Explain what is the difference between null and nul?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What is wild pointer in c?
How can a program be made to print the line number where an error occurs?
What is the purpose of & in scanf?
How is pointer initialized in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What is string function in c?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
largest Of three Number using without if condition?
What is a stream water?