Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Is malloc memset faster than calloc?

1016


Why array is used in c?

971


Explain the advantages and disadvantages of macros.

1035


Is void a keyword in c?

924


Do you have any idea how to compare array with pointer in c?

991


Why is #define used?

1229


What is the purpose of macro in C language?

1064


What is structure padding and packing in c?

1005


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

2136


What is sorting in c plus plus?

926


How do we open a binary file in Read/Write mode in C?

1176


What do you mean by a local block?

1027


Differentiate between a structure and a union.

1227


How can you avoid including a header more than once?

928


Which of these functions is safer to use : fgets(), gets()? Why?

1045