Question
STATS 104-A General Utilities - 1 PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS! I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE.
STATS 104-A
General Utilities - 1
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. _______variable type defined in the header stdlib.h is an integer type of the size of a wide character constant.
a) size_t
b) wchar_t
c) div_t
d) ldiv_t
2. Which of the following is the correct description of EXIT_FAILURE?
a) This is the value for the exit function to return in case of failure
b) This is the value for the exit function to terminate the program
c) This is the value for the exit function to return in case of success
d) This is the value for the exit function to return in case it is the maximum value
3. RAND_MAX macro is the maximum value returned by the rand function.
a) true
b) false
4. Which of the given function converts the string pointed to, by the argument str to a floating-point number?
a) atof(const char *str)
b) strtod(const char *str, char **endptr)
c) atoi(const char *str)
d) atol(const char *str)
5. The_______function converts the initial portion of the string pointed to by, to int representation.
a) atof()
b) atoi()
c) strtod()
d) atol()
6. atol(const char *str) Converts the string pointed to, by the argument str.
a) to a long integer
b) to a integer
c) to a floating point number
d) to a unsigned long integer
7. What will be the output of the following C code?
char str[20]; str= "123546"; res= atof(str); printf("String value = %s, Float value = %f ", str, res);
a) String value = 123546, Float value = 123546.0
b) String value = 123546 , Float value = 123546.000000
c) String value = 123546 , Float value = 0.000000
d) String value = 123546 , Float value = 123546.000
8. What will be the output of the following C code?
char str[]; strcpy(str, "Hello"); res = atof(str); printf("String value = %s, Float value = %f ", str, res);
a) String value = Hello, Float value = 0.000000
b) String value = Hello, Float value = 0
c) String value = "Hello" , Float value = 0.000000
d) String value = "Hello" , Float value = 0
9. What will be the output of the following C code?
char str[20]; strcpy(str, "123456"); res = atoi(str); printf("%s %d ", str, res);
a) 123456 0
b) 123456 0.0
c) 123456 123456
d) 123456 123456.0
10. What will be the output of the following C code?
char str[] ; strcpy(str, "Hello"); res = atoi(str); printf(" %s %d ", str, res);
a) Hello 0.000000
b) "Hello" 0.000000
c) Hello 0
d) "Hello" 0
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