Write code for initializing one dimentional and two
dimentional array in a C Program?
Answer Posted / shruti
Ans no. 4 is correct..
incase u have to initialise an array have more number of
elements as i 100 or 200..
eg..
int a[50];
then u can use following functions:
**YOU CAN INITIALISE IT TO A PARTICULAR VALUE ONLY USING
THE BELOW CODE..
int a[50];
int i;
for (i = 0 ; i < 50 ; i++)
{
a[i] = 0;
}
similarly for 2D
for(i = 0 ; i < 50 ; i++)
{
for(j = 0 ; j < 50 ; j++)
{
a[i][j] = 0;
}
}
| Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What are qualifiers?
What are pointers? What are different types of pointers?
What is the difference between break and continue?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is the difference between NULL and NUL?
What is the c language function prototype?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Write a C program in Fibonacci series.
What is non linear data structure in c?
What is this infamous null pointer, anyway?
Does c have enums?
What are the general description for loop statement and available loop types in c?
Difference between goto, long jmp() and setjmp()?
Differentiate between #include<...> and #include '...'