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
Write the test cases for checking a variable having value in range -10.0 to +10.0?
In c programming language, how many parameters can be passed to a function ?
what is reason of your company position's in india no. 1.
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
How can you invoke another program from within a C program?
How can I read and write comma-delimited text?
What is the purpose of sprintf?
What is sizeof int?
How can you check to see whether a symbol is defined?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
How can I convert a number to a string?
How #define works?
What are header files? What are their uses?
Who developed c language?
What is a structure in c language. how to initialise a structure in c?