Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Interview Questions

What is cohesion in c?

0 Answers  


Is a house a mass structure?

0 Answers  


please give code for this 1 2 4 7 11 16

11 Answers   Intel, Wipro,


What's a "sequence point"?

3 Answers  


Find the O/p of the following struct node { char *name; int num; }; int main() { struct node s1={"Harry",1331}; struct node s2=s1; if(s1==s2) printf("Same"); else printf("Diff"); }

1 Answers  






Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .

4 Answers   State Bank Of India SBI,


What are the 5 elements of structure?

0 Answers  


What are external variables in c?

0 Answers  


Explain that why C is procedural?

0 Answers   Maveric, Verifone,


what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }

6 Answers  


why you will give me a job in TCS.

7 Answers   TCS,


what is the use of operator ^ in C ? and how it works?

2 Answers  


Categories