If I want to initialize the array like.
int a[5] = {0};
then it gives me all element 0.
but if i give int a[5] = {5};
then 5 0 0 0 0 is ans.
what will I do for all element 5 5 5 5 5 in a single
statement???

Answer Posted / n

int a[5]={5,5,5,5,5};

Is This Answer Correct ?    27 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are there constructors in c?

598


What is a memory leak? How to avoid it?

577


What is a good data structure to use for storing lines of text?

600


What is a structure and why it is used?

621


What is variable declaration and definition in c?

503






How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

649


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

1593


What is the purpose of & in scanf?

598


Write a code of a general series where the next element is the sum of last k terms.

596


What is indirection? How many levels of pointers can you have?

659


How can I call a function with an argument list built up at run time?

641


Write a program to check prime number in c programming?

598


a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none

725


Define and explain about ! Operator?

615


List out few of the applications that make use of Multilinked Structures?

1305