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 the difference between text and binary i/o?

0 Answers  


What is #include called?

0 Answers  


Can we write a program without main() function?

9 Answers  


How can you print HELLO WORLD without using "semicolon"?

7 Answers   HCL, Infosys,


Explain what are binary trees?

0 Answers  






Can you please explain the difference between strcpy() and memcpy() function?

0 Answers  


What are the features of c languages?

0 Answers  


What is meant by gets in c?

0 Answers  


What is the difference between array and pointer?

0 Answers  


What is the use of header files?

0 Answers  


Are global variables static in c?

0 Answers  


write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com

6 Answers  


Categories