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

Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1292


What are qualifiers?

1065


What are pointers? What are different types of pointers?

1159


What is the difference between break and continue?

1557


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1070


What is the difference between NULL and NUL?

1312


What is the c language function prototype?

1099


List the difference between a 'copy constructor' and a 'assignment operator' in C?

1099


Write a C program in Fibonacci series.

1100


What is non linear data structure in c?

1043


What is this infamous null pointer, anyway?

1070


Does c have enums?

1114


What are the general description for loop statement and available loop types in c?

1136


Difference between goto, long jmp() and setjmp()?

1187


Differentiate between #include<...> and #include '...'

1072