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
#include
Which is best linux os?
What is the use of bitwise operator?
What is #include stdlib h?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is function what are the types of function?
Can we compile a program without main() function?
code for find determinent of amatrix
Explain what is meant by 'bit masking'?
What is a wrapper function in c?
What is meant by preprocessor in c?
which type of aspect you want from the student.
What is variable in c example?
What are enums in c?
what are the 10 different models of writing an addition program in C language?