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???

Answers were Sorted based on User's Feedback



If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i ..

Answer / n

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

Is This Answer Correct ?    27 Yes 1 No

If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i ..

Answer / jahid

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

Is This Answer Correct ?    8 Yes 1 No

If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i ..

Answer / litan parida

int a[1000];
memset(&a,0,sizeof(a))

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How to write a program to receive an integer & find its octal equivalent by using for loop?

1 Answers   Google,


Explain is it better to bitshift a value than to multiply by 2?

0 Answers  


who will call your main function in c under linux?

2 Answers  


How is null defined in c?

0 Answers  


What is the best way of making my program efficient?

0 Answers  






Why static is used in c?

0 Answers  


Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.

2 Answers   Infosys,


How can I avoid the abort, retry, fail messages?

0 Answers  


how will you write a program on linked lists using JAVA programming???????????

1 Answers   Keane India Ltd,


What is merge sort in c?

0 Answers  


write a program to add two numbers of any size.....(remember any size)

1 Answers  


Where static variables are stored in memory in c?

0 Answers  


Categories