ChERevewuetone .doc: Prorected Wew - Word Fil: Hare Irsat Din ayou: Rdesnss Maii
ID: 3877394 • Letter: C
Question
ChERevewuetone .doc: Prorected Wew - Word Fil: Hare Irsat Din ayou: Rdesnss Maiings Rve e Telme what you wan to do 3. Which of the following is true of variable declarations? a. Two variables of the same type can be declared in the same statement. b. Two variables of different types can be declared in the same statement. c. Two variables of the same type must be declared in the same statement. d. Two variables of the same type cannot coexist in a program. 4. Assume that you have two variables declared as int varl - 3; and int var2 8. Which of the following would display 838? a. WriteLine ("O 1) 12", varl, var2) b. WriteLine ( " { 0 } { 1 } { 0 } " , var 1, var2 ) ; c.writeLine ("({1}{2}", var2, varl); d. WriteLine ( " { 0 } { 1 } { 0 } ", var2, var1) ; here to soaraExplanation / Answer
Answer:-
3. a) two variables of the same type can be declared in the same statement.
4. d) WriteLine("{0},{1},{0}",var2,var1);
Explanation:-
To print 838 we have to access var2 first then var1 and again var2, for doing this we acces var2 by their given index which is {0}, similarly var1 {1}.