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
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
What is extern variable in c with example?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is the purpose of the preprocessor directive error?
How variables are declared in c?
Explain how do you use a pointer to a function?
How do c compilers work?
What are the advantages of external class?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
What will be your course of action for a push operation?
Does free set pointer to null?
What are valid signatures for the Main function?
What is getch () for?
What is the modulus operator?