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 pointers?
What is difference between %d and %i in c?
Write a program to swap two numbers without using third variable?
What is malloc() function?
Explain what math functions are available for integers? For floating point?
What is clrscr in c?
What is static memory allocation?
What is extern keyword in c?
what is stack , heap ,code segment,and data segment
Explain bit masking in c?
Write a program for Overriding.
Which node is more powerful and can handle local information processing or graphics processing?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is structure packing in c?
Explain how can I open a file so that other programs can update it at the same time?