Assume the following declarations:
int b[] = {10, 20, 30};
int *x = b + 1;
Choose all the expressions that are defined and evaluate to 10
A. *b
B. b[1]
C. *x
D. x[-1]
E. x[1] - b[1]
answer: A,D,E
########################################################
Give a ThumbsUp if you found this answer Helpful :)
#######################################################
################################################################
............ Still having trouble understanding the answer ? Feel
free to ask in the comment section.......
Assume the following declarations: int b[] = {10, 20, 30}; int *x = b + 1;...
1. (3% each) Given the following declarations: int a-4 int b-6: float5.0 Evaluate the following Java expressions: a) (5 + a / b) % 2- b) c / (10 % b) C) 5 * 300 7 + 8 / 3-6
Which are invalid variable declarations that will cause compiler errors? a. int number$1 = 10; b. int number#1 = 10; c. int 21stJump = 10; d. int number_1 = 10; e. int Number1 = 10;
4. Consider the following declarations: I. const int* x I. const int const x II. int const x; IV. int x V. int x Match declarations I-V with the following: (a) the integer it points to can change in value. A pointer to an integer that can never change the address it points to, but (b) A pointer to a pointer to an integer A pointer whose address can never change, and whose integer value that (c) it points to...
Which of the following are valid array declarations? a. int[] array- new int[10]; b. double [array double[10]; c. charl charArray "Computer Science"; None of the above Analyze the following code: class Test public static void main(Stringl] args) System.out.println(xMethod(10); public static int xMethod(int n) System.out.println("int"); return n; public static long xMethod(long n) System.out.,println("long"); return n The program displays int followed by 10 The program displays long followed by 10. The program does not compile. None of the above. tions 3-4 are...
24) A C program has the following declarations: float x = 10.0, y = 5.5, z = 2.1; int i = 3, j = 5, k = 7, m; EVALUATE each of the following expressions. SHOW YOUR WORK, including the type of each sub expression (indicating a float with a decimal point). If the expression would compile and runs but would produce garbage output, mark GARBAGE and EXPLAIN. If you are not confident of your answer, type in, compile and...
Suppose the following declarations and statement are m effect What are the values of and b in each ease? int a = 10, b - 20, x = &a, y = &b; x = y; int a - 10, b - 20, x =6a, y =&b; x = y; x = 2; y = 5; int a = 10, b = 20, x =&a, y = &b; x = y; x + = 2; [y] --;
assume we have the following constant declarations const int MAXIMUM = 60; const int letters_Size = 15; we then have the function void Adjusting(char C_string[ ] [ ], int amount_words); assume that youve taken in a string from the user now just simply read the input wnd analyze the sentence into its parts and describe its roles basically parse into words and save it and sort into an array of C-strings. note code is in C++ complete the function definition...
Assume you have the following variable declarations and assignments: int j2: int k3; char c'h float x2.3 Write single printf command to print the following output. The value of j is 2, and the value of x is -2.30, and the character c contains the value h. Note: You must make use of the variables as indicated by the desired output. For example, if the required output is: The value of j is 2. Then the following answer would be...
basic c++ 2. AC++ program contains the following C++ code (assume an int occupies 2 bytes each in memory): int x[ ] = { 10, 20, 30, 40, 50, 60, 70, 80); int *ptrx ptrx = x; Array x starts at memory location 2140. a. What is the value assigned to ptrx? b. What is the value of (x+2)? c. What is the value of *x? d. What is the value of (*x+2)? e. What is the value of *(x+2)?...
1.) Using the following declarations and a member of the Array class, int [ ] bArray = new int [10]; int location; Using a method in the Array class, write a statement that would order the values in the bArray array in ascending order. ___________________ HINT: You must write the full statement which includes a call to a method in the Array class. 2.) Using the following declarations and a member of the Array class, int [ ] bArray =...