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
What is scanf () in c?
What is a const pointer?
Is void a keyword in c?
Write a program with dynamically allocation of variable.
Write a program to print fibonacci series using recursion?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What are the different data types in C?
Not all reserved words are written in lowercase. TRUE or FALSE?
Apart from dennis ritchie who the other person who contributed in design of c language.
How can I write a function analogous to scanf?
How to declare pointer variables?
What are the types of data types and explain?
What is wrong with this declaration?
What is an expression?
which is conditional construct a) if statement b) switch statement c) while/for d) goto