Floating Point Functions in C Standard Library

Question: What are Different Floating-Point Functions in Standard C Library? Answer: Most of the floating-point functions defined in ‘math.h’ header take their arguments as double and return double values. These functions range from Trigonometric to Hyperbolic to Logarithmic and Exponential to Power functions to Floor, Ceiling, Absolute value and Remainder functions to String conversion functions. … Read more

advertisement

Which String Conversion Functions in Standard C Library Return Type “double” Values

Question: Which String Conversion Functions in Standard C Library Return Type “double” Values? Answer: Following two functions take string as arguments and convert them into double values. double atof(char const *string); double strtod(char const *string, char **ptr2loc); These are defined in ‘stdlib.h’ header. Notice that if second argument to ‘strtod()’ function is not NULL then … Read more

advertisement

String Conversion Functions in C

Question: What are Different String Conversion Functions in Standard C Library? Answer: We have following functions which take character string with valid integers as first argument and return integer and long integer respectively as function value. These perform base 10 conversions. int atoi(char const *string); long int atol(char const *string); Function given below long int … Read more

advertisement

Random and Pseudo Random Numbers in C

Question: What are Random and Pseudo-Random Numbers and how are they Used in a C Program? Answer: GNU provides facilities for generating ‘pseudo-random numbers’. These aren’t truly random; sequence of numbers generated repeats periodically, though, over a large period so that we generally ignore this. Where, actually, we need to use such numbers implies situations, … Read more

advertisement

Integer Functions in Standard C Library

Question: What are Various Integer Functions in Standard C Library? Answer: This group of functions return integer values. These functions comprise three categories viz. arithmetic, random numbers and string conversion functions. Arithmetic group of functions are prototyped below int abs(int value); long int labs(long int value); div_t div(int numerator, int denominator); div_t ldiv(long int numerator, … Read more

advertisement

What is Standard Library in C?

Question: What is Standard Library and How this Empowers a C Programmer Answer: Programming in C requires any C program to use various different functions for different requirements to be best taken care of. For ex. to copy a string ‘strcpy()’ library function, for printing formatted data to stdout, ‘printf()’ is used. There are several … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.