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

What is infinite loop?

630


swap 2 numbers without using third variable?

661


Where static variables are stored in c?

586


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1477


What is union in c?

637






What is a pointer value and address in c?

636


What are structure types in C?

669


What are volatile variables in c?

519


What is a void pointer in c?

608


Explain what is the best way to comment out a section of code that contains comments?

720


What is a protocol in c?

559


Is there sort function in c?

578


what is the structure pointer?

1644


Explain how do you override a defined macro?

586


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

668