adspace


What is array in c with example?

Answer Posted / Narendra Singh Rajput

An array in C is a collection of variables of the same data type stored in contiguous memory locations. You can create an array by defining its name and specifying its size between square brackets (e.g., int arr[10]). Accessing elements within the array is done using indexes, where each element's index corresponds to its position in the array.nnHere's a simple example:nn```cnint arr[5] = { 1, 2, 3, 4, 5 }; /* initialize an array with 5 elements */narr[0]; /* access the first element (value: 1) */narr[2]; /* access the third element (value: 3) */n```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I implement sets or arrays of bits?

1129


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2836


hi send me sample aptitude papers of cts?

2258


write a program to find out prime number using sieve case?

2182


What is the difference between union and anonymous union?

1413


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1625


What is dynamic dispatch in c++?

1142


ATM machine and railway reservation class/object diagram

5344


what is ur strangth & weekness

2598


develop algorithms to add polynomials (i) in one variable

2269


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2218


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1364


What is pointer to pointer in c with example?

1205


will u please send me the placement papers to my mail???????????????????

1939


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1307