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
What are the main characteristics of c language describe the structure of ac program?
What is the purpose of scanf() and printf() functions?
Which type of language is c?
What is a scope resolution operator in c?
What are the features of c language?
What is structure data type in c?
Explain what does the function toupper() do?
List the variables are used for writing doubly linked list program.
How can you increase the allowable number of simultaneously open files?
Explain what are multidimensional arrays?
What standard functions are available to manipulate strings?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What is the use of a conditional inclusion statement in C?
What is actual argument?
List some basic data types in c?