Given only putchar (no sprintf, itoa, etc.) write a routine
putlong that prints out an unsigned long in decimal.
Answer Posted / sanjay
#include<stdio.h>
#include<conio.h>
int main()
{
unsigned long abc=234455787; int div1;
div1=print_int(abc);
getch();
}
int print_int(long val)
{ int div=1; char c;
if (val>=10)
{
div=print_int(val/10);
}
putchar(val%10+48);
return (1);
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can you relate the function with the structure? Explain with an appropriate example.
Write a program to model an exploding firecracker in the xy plane using a particle system
write a simple calculator c program to perform addition, subtraction, mul and div.
Develop a routine to reflect an object about an arbitrarily selected plane
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
Cluster head selection in Wireless Sensor Network using C programming language.
write a program for area of circumference of shapes
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
could you please send the program code for multiplying sparse matrix in c????
how to test pierrot divisor
Sir... please give some important coding questions asked by product companies..
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00
why nlogn is the lower limit of any sort algorithm?
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']