Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? ?->(Show Answer!)
Question Set

1. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?





Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 01 Jun 2017 06.00 pm
    If the index of the array size is exceeded, the program will crash. Hence "option c" is the correct answer. But the modern compilers will take care of this kind of errors. Example: Run the below program, it will crash in Windows (TurboC Compiler) #include<stdio.h> int main() { int arr[2]; arr[3]=10; printf("%d",arr[3]); return 0; } Since C is a compiler dependent language, it may give different outputs at different platforms. We have given the Turbo-C Compiler (Windows) output. Please try the above programs in Windows (Turbo-C Compiler) and Linux (GCC Compiler), you will understand the difference better.
Show Similar Question And Answers
QA->Correct sentences among the following are: ) The tea is too hot that I cannot drink (2) Work hard, lest you should miss the chance (3) Unless you study well, you will fail (4) Unless you study well, you will pass....
QA->……..is a coin whose face value is more than the value of the metal?....
QA->Currency whose face value is higher than the internal value is called?....
QA->Who said ‘Happiness is when what you think; what you say; and what you do are in harmony’?....
QA->If you have a Power point show you created and want to send using E-mail to another teacher you can add the show to your E-mail message as an______....
MCQ->What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?....
MCQ->Which of the following statements are correct about the C#.NET code snippet given below? int[] a = {11, 3, 5, 9, 4}; The array elements are created on the stack. Refernce a is created on the stack. The array elements are created on the heap. On declaring the array a new array class is created which is derived from System.Array Class. Whether the array elements are stored in the stack or heap depends upon the size of the array.....
MCQ->Which of the following statements are correct about the exception reported below? Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds of the array. at IndiabixConsoleApplication.Program.Main(String[] args) in D:\ConsoleApplication\Program.cs:line 14 The program did not handle an exception called IndexOutOfRangeException. The program execution continued after the exception occurred. The exception occurred in line number 14. In line number 14, the program attempted to access an array element which was beyond the bounds of the array. The CLR could not handle the exception.....
MCQ->Which of the following statements are correct about an array? 1: The array int num[26]; can store 26 elements. 2: The expression num[1] designates the very first element in the array. 3: It is necessary to initialize the array at the time of declaration. 4: The declaration num[SIZE] is allowed if SIZE is a macro.....
MCQ->Consider the following statements (L is the length of array between centres of end antennas and A is wave-length)Width of major lobe between nulls of broad side array and end fire array are different.Directive gain of broadside array and end fire array are different.Directive gain of broadside array is 4 Which of the above statements are correct?....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution