what is an array
Answers were Sorted based on User's Feedback
Answer / srsabariselvan
an array is a collection of same type of data.
for eg:
list of student name,collection of roll numbers.
each element has unique id(index).
Declaration:
data_type a[size];
a[index]=number;
Eg:
int a[10];
a[0]=2;
a[1]=3;
.
.
.
a[9]=22;
printf("%d",a[9]);
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / anusha
an array is a continous memory of same data type.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / j j ramesh
it is the ordered collection of same type of variable.
accessed by index value range starts from 0
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mukul garg
an array is a collectiom of similar data types .an array
index always stsrt from zero if the size of array is n then
it can store n elements .
int a[5]={1,2,3,4,5};
Is This Answer Correct ? | 1 Yes | 1 No |
when to use : in c program?
How to calculate sum
What is the difference between if else and switchstatement
# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none
Write a program to find the number of times that a given word(i.e. a short string) occurs in a sentence (i.e. a long string!). Read data from standard input. The first line is a single word, which is followed by general text on the second line. Read both up to a newline character, and insert a terminating null before processing. Typical output should be: The word is "the". The sentence is "the cat sat on the mat". The word occurs 2 times.
Explain the difference between getch() and getche() in c?
Explain the use of keyword 'register' with respect to variables.
What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these
How do you view the path?
Explain #pragma statements.
Differentiate Source Codes from Object Codes
how to write a c program to print list of fruits in alpabetical order?