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
What is sizeof return in c?
Which programming language is best for getting job 2020?
How macro execution is faster than function ?
What are derived data types in c?
What is a MAC Address?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Explain what header files do I need in order to define the standard library functions I use?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Is c procedural or functional?
Is c programming hard?
For what purpose null pointer used?
What is pass by value in c?
How does struct work in c?
What are qualifiers?
What are loops c?