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 facialities provided by you after the selection of the student.
What is difference between && and & in c?
When can you use a pointer with a function?
Was 2000 a leap year?
Can an array be an Ivalue?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
When would you use a pointer to a function?
Write programs for String Reversal & Palindrome check
Explain built-in function?
What are the types of pointers?
code for quick sort?
Explain modulus operator.
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What does %p mean?