Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elementary Algebra

Authors: Charles P McKeague

2nd Edition

1483263819, 9781483263816

More Books

Students also viewed these Mathematics questions

Question

what is a peer Group? Importance?

Answered: 1 week ago

Question

2. Identify conflict triggers in yourself and others

Answered: 1 week ago