input any 4 digit number and find the difference of all the
digits?
Answer Posted / nitin garg
int j,num,rem,diff=0;
printf("
Enter Digit
");
scanf("%d",&num);
while(num!=0)
{
rem=num%10;
j=rem+rem;
diff=diff-rem;
num=num/10;
}
diff=diff+j;
printf("
Difference of Digit is : %d",diff);
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you return multiple values from a function?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Explain how can I pad a string to a known length?
Why static variable is used in c?
What is difference between union and structure in c?
Is c pass by value or reference?
Is struct oop?
When can a far pointer be used?
what is the format specifier for printing a pointer value?
What is pivot in c?
What is data structure in c programming?
Is c programming hard?
What is break statement?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Explain what is the difference between far and near ?