Question

in c programming Is it a compile error to specify more values than elements in an...

in c programming Is it a compile error to specify more values than elements in an array?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

It won't give compile error if you specify more values than elements in an array.

But it gives run time error.
Add a comment
Know the answer?
Add Answer to:
in c programming Is it a compile error to specify more values than elements in an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Is it a compile error to specify more values than elements in an array? A common...

    Is it a compile error to specify more values than elements in an array? A common application in an array is to exchange the contents of two elements such as when one sorts the array.   Would there be any advantage to exchanging addresses in array?   Why or why not? There are two arrays one called A[50][30]  and one called B[50][30].   The elements in each array are unique and different .  Explain by pseudo-code the ways one could employ to move elements from the array...

  • PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE...

    PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE PLEASE USE C AS A PROGRAMMING LANGUAGE 11. Initialize a integers in the two-dimensional array testArray to the values 1 through 9 using 1 or more while loops so that the array could be visualized as: 1 2 3 LA 5 6 7 8 9...

  • Using C programming Write a function that reverses the elements of an array of integers so...

    Using C programming Write a function that reverses the elements of an array of integers so that the first becomes the last. Hint use a temporary variable for swapping values. Test with an odd and even number of elements

  • C Programming Given the following two arrays, write a for loop that copies all values in...

    C Programming Given the following two arrays, write a for loop that copies all values in the first array that are greater than 50 into the second array. The contents of the second array should not skip elements, so the final contents of a2 should be {59, 61, 94, 76, 89, 0, 0, 0, 0, 0}. Note: Consider having two integer counters – one for the loop control variable that will access the elements of the source array, a1, and...

  • C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C...

    C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! Q2 (20 marks): remembering state, conditions, functions Write a function that takes two arguments an array and the size of the array and returns a count of all of the numbers between 2 and 5 inclusive. The code below shows how your function will be called. int main(void) { int values[6]={1,2,4,5,3,6}; int size=6; printf("There are %d values between 2 and 5 (inclusive)\n",...

  • C programming Write a function that goes through all elements of an array of size n,...

    C programming Write a function that goes through all elements of an array of size n, and output the minimum and maximum values using pointers. Since C functions can only return one value, you must use pointers to output the minimum and maximum values from the function. You are not expected to print the values on the screen. Note: you will be assessed on the functionality and the coding style.

  • JAVA CODE This program causes an error and crashes. Compile and give it a test run,...

    JAVA CODE This program causes an error and crashes. Compile and give it a test run, note the exception that is thrown. Then do the following to fix the problem 1. Write code to handle this exception 2. Use try, catch and finally blocks. 3. Display, the name of the exception 4. Display a message from the user about what happened. Here is the starting file BadArray.java: public class BadArray { public static void main(String[] args) { // Create an...

  • Arrays Arravs Introduction Your ninth programming assignment will consist of two C++programs. Your programs should compile...

    Arrays Arravs Introduction Your ninth programming assignment will consist of two C++programs. Your programs should compile correctly and produce the specified output. Please note that your programs should comply with the commenting and formatting rules we discussed in class. Please see the descriptive ile on eLearning for details. Program 1- Linear Search Algorithm In Computer Science, it is often very important to be able to locate a specific data item inside a list or collection of data. Algorithms that perform...

  • Hash Tables. In C programming language, solve these problems efficiently using Hashtables and analyze the running...

    Hash Tables. In C programming language, solve these problems efficiently using Hashtables and analyze the running time of your solution. 1. Given an unsorted array of length N, print all elements that appear more than once. 2. Find the intersection of K unsorted arrays of N elements each. The intersection consists of elements that appear in all the K arrays.

  • ***************C PROGRAMMING ONLY************* Demonstrate the ability to create an array on the stack Demonstrate the ability...

    ***************C PROGRAMMING ONLY************* Demonstrate the ability to create an array on the stack Demonstrate the ability to create an array on the heap allowing user to choose the number of values to store. Demonstrate the ability to store an array of Struct values on both the stack and the heap. Program Specifications: 1. Create a struct with at least 3 fields - any struct you want but explain it in your comments in the code. Populate at least 10 elements...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT