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
How can I do graphics in c?
Write program to remove duplicate in an array?
Can you please explain the difference between exit() and _exit() function?
When is a void pointer used?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
write a c program in such a way that if we enter the today date the output should be next day's date.
Explain built-in function?
can any one provide me the notes of data structure for ignou cs-62 paper
What is pass by reference in c?
Write a program to swap two numbers without using a temporary variable?
What are the types of functions in c?
What does != Mean in c?
What is this infamous null pointer, anyway?
What is the best way of making my program efficient?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]