Question
STATS 105- A General Utilities - 2 PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS! I WANT THIS IN 5MINS. BECAUSE DUE DATE IS
STATS 105- A
"General Utilities - 2"
PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS!
I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE. THANKS
I WILL REPORT THOSE WHO WILL FLAG THIS!
READ COMMENTS FOR INSTRUCTIONS
1. What will be the output of the following C code?
char word[20 ] = "1.234555 WELCOME"; char *w; double dis; dis= strtod(word, &w); printf("The number is %lf ", dis); printf("String is |%s|", w);
a) The number is 1.234555 String is |WELCOME|
b) The number is 1.2345550 String is |WELCOME|
c) The number is 1.234555 String is |1.234555 WELCOME|
d) Errror
2. Which statement is correct work reference to endptr?
double strtod(const char *nptr, char **endptr);
a) A pointer to the starting string is stored in the object pointed to by endptr, provided that endptr is a null pointer
b) A pointer to the nal string is stored in the object pointed to by endptr, provided that endptr is not a null pointer
c) A pointer to the final string is stored in the object pointed to by endptr, provided that endptr is a null pointer
d) A pointer to the starting string is stored in the object pointed to by endptr, provided that endptr is not a null pointer
3. Which of the following functions decomposes the input string into three pans: an initial, possibly empty, sequence of white-space characters?
a) strtod()
b) atof()
c) atol()
d) strtol()
4. The______function is used to convert the initial portion of the string pointed to by, to unsigned long int representation.
a) strtod()
b) atol()
c) strtoul()
d) strtol()
5. Which of the following is the correct syntax of the function strtoul()?
a) unsigned long int strtoul(const char *n, char **ptr, int base)
b) unsigned long int strtoul(const char *n, char **ptr)
c) unsigned long int strtoul(const char *n)
d) int strtoul(const char *n)
6. Select the right statement with reference to malloc() and calloc().
a) malloc() does not set the memory to zero whereas calloc() sets allocated memory to zero
b) malloc() sets the memory to zero whereas calloc() does not set allocated memory to zero
c) malloc() sets the memory to zero whereas calloc() sets allocated memory to zero
d) malloc() does not set the memory to zero whereas calloc() does not set allocated memory to zero
7. The calloc() function allocates space for an array of n objects, each of whose size is defined by size. Space is initialized to all bits zero.
a) true
b) false
8. Is this right explanation to the given code?
void *calloc(size_t n, size_t size) #n -- This is the number of elements to be allocated. #size -- This is the size of elements.
a) true
b) false
9. Which among the given function does not return a value?
a) strtoul()
b) strtol()
c) rand()
d) srand()
10. Which function returns a pseudo-random integer?
a) srand()
b) rand()
c) malloc()
d) alloc()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started