What does the function func do Count number of digits in a d

What does the function func do? Count number of digits in a decimal number Count the number of 1s in the binary representation of a decimal number Count the number of 1s in a decimal number None of above Which the following is(are) legal way(s) to write the number 97? \'a\' 061 97 0x141 None of above Assume that a program contains the following declarations: char c = \"1\" short s = 2 int I = 3 float f = 6. 5 t double d = 7.5 Give the the type of each expression listed below: c*i f/c d/s f-d char float double float int char shot double int float double double None of above An array named as count is defined in a C program function, to get the number of elements in this array, which expression(s) can be used? count length size of(count) size of (count[1])

Solution

7) you have not provided func() code to answer this, it is not a built in method...

8)answer: c

explanation : to write a number , we simply write it in integer form, all other are indirect ways to represent 97

9)answer: c

explantion: the hierarchy order of the data types short<=char<int<float<double.. when a datatype is operated with another datatype through an operator , then the resultant value would be of type which has higher hierarchy... suppose in f/c, f is float, c is char, f is higher so resultant is float..

10)answer d

explantion: sizeof(count[0]) it returns the size of int that is 4bytes becaues c[0] is int.. sizeof(count) it returns the size of all elements that is (size of int*number of all elements).. that is why is we are dividing with size of int... c is also a correct answer

 What does the function func do? Count number of digits in a decimal number Count the number of 1s in the binary representation of a decimal number Count the nu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site