Question

Which of the below array initialization results in COMPILE TIME ERROR? int arr[2]={10,20,30); Oint arr[]={10,20,30); int arr[

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

I uploaded the images with clear explanation about COMPILE TIME ERROR and RUN TIME ERRORS.And explained the solution with reasons for all option.

And solution for the given Question.

Answer: int arr[2]={10,20,30};(option 1)

All the other do not generate any compile time errors

Explanation:

performed cation Error: Error is an illegal coperation oppe by an user or developer . * It leads to abnormal behaviour of proi) Compile time Errors program a compile impiler fails to * Toompile time errors orefers to a state When compiler fails to .cNotes *These are futher categorized into many types like syntar eviors, legical evenors etc --- Given 1) int arr[2] = {10,20,*) imt arc] = 10,20,303 *H is a maild uintialization. Even though the size of away is not mentioned. The size is automaticall4) I int arx[5] = }; It is also valid intialization. * Here size is declared . But there are no elements in array. so option

If you have any doubts please ask using comments.

Have A Great Day!

Add a comment
Know the answer?
Add Answer to:
Which of the below array initialization results in COMPILE TIME ERROR? int arr[2]={10,20,30); Oint arr[]={10,20,30); int...
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
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
ADVERTISEMENT