Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Assume the following C variable declaration:i... Start Learning for Free
Assume the following C variable declaration:
int * A [10], B [10][10];
Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program?
  1. A [2]
  2. A [2] [3]
  3. B [1]
  4. B [2][3]
  • a)
    1, 2 and 4
  • b)
    2, 3 and 4
  • c)
    2 and 4
  • d)
    4 only
Correct answer is option 'A'. Can you explain this answer?
Most Upvoted Answer
Assume the following C variable declaration:int * A [10], B [10][10];W...
Answer:

Variable Declaration:

Before explaining the correct option, let's understand the variable declaration first.

int * A [10] - It declares an array of 10 integer pointers.

B [10][10] - It declares a 2-dimensional array of 10x10 integers.

Possible Assignments:

Now, we need to find out the expressions that will not give compile-time errors if used as the left-hand side of the assignment statement(s).

1. A [2] - It is a valid expression and can be assigned a value that must be an integer pointer.

2. A [2] [3] - It is also a valid expression and can be assigned a value that must be an integer.

3. B [1] - It is a valid expression and can be assigned a value that must be an array of integers.

4. B [2][3] - It is also a valid expression and can be assigned a value that must be an integer.

Therefore, options 1, 2, and 4 are correct expressions that will not give compile-time errors if used as the left-hand side of the assignment statement(s) in a C program.

Correct option:

a) 1, 2 and 4
Free Test
Community Answer
Assume the following C variable declaration:int * A [10], B [10][10];W...
A is an array of pointers to int, and B is a 2-D array.
A[2] can take a pointer.
A[2][3] can take an int.
B[1] is the base address of array and it cannot be changed as array in C is a constant pointer.
B[2][3] can take an integer.
So, (1) is the answer.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer?
Question Description
Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer?.
Solutions for Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer?, a detailed solution for Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? has been provided alongside types of Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Assume the following C variable declaration:int * A [10], B [10][10];Which of the following expressions will not give compile-time errors if used as left hand side(s) of assignment statement(s) in a C program? A [2] A [2] [3] B [1] B [2][3]a)1, 2 and 4b)2, 3 and 4c)2 and 4d)4 onlyCorrect answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev