Answer Posted / geetha gajendiran
array is a collection of similar data types;
i can explain with following example:
#include<stdio.h>
void main()
{
int x;
x=5;
x=10;
printf("\nx=%d",x);
}
here 10 is assigned to x.thereby 5 get lost.this is
applicable when only one value is stored.
but,if we want to store more than one value at a time in a
single variable.we go for using the array
suppose we want to arrange the payment of 100 workers in
ascending order.we have 2 options
1)construct 100 vari8ables to store the payment amount
obtained by 100 different workers.
2)construct one(1) variable (called array or subscripted
variable) capable of storing or holding all the hundred
values.
for more question and answers regarding computer
engineering please mail to me.
Is This Answer Correct ? | 20 Yes | 4 No |
Post New Answer View All Answers
Describe how arrays can be passed to a user defined function
Why we use stdio h in c?
Explain modulus operator.
What is the right type to use for boolean values in c?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Is fortran still used today?
What is a protocol in c?
What is the size of empty structure in c?
What is call by reference in functions?
What are the disadvantages of a shell structure?
Do variables need to be initialized?
Explain heap and queue.
When is a void pointer used?
Explain what is the benefit of using an enum rather than a #define constant?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)