Correct Answer: atoi() Converts a string to an integer itoa() Convert an integer to a string gcvt() Converts a floating-point number to a string #include "stdlibh" main() { char s[] = "12345"; char buffer [15], string[20]; int i; i = atoi (s); printf("\n%d",i); gcvt (20141672, 4, buffer); printf ("\n%s", buffer); itoa(15, string,2); printf ("\n%s", string); }
10. What's the difference between the functions rand(), random(), srand() and randomize()?
Correct Answer: rand() returns a random number random() returns a random number in a specified range srand() initialise a random number generator with a given seed value randomize() initializes a random number generator with a random value based o time