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
Why is it important to memset a variable, immediately after allocating memory to it ?
Explain indirection?
Is it better to use a macro or a function?
Is there sort function in c?
How do we declare variables in c?
What is the size of enum in bytes?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Why do we use stdio h and conio h?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What are the 32 keywords in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is use of #include in c?
what is event driven software and what is procedural driven software?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
How can I read/write structures from/to data files?