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 / litan parida
int a[1000];
memset(&a,0,sizeof(a))
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is c token?
Linked lists -- can you tell me how to check whether a linked list is circular?
Why double pointer is used in c?
Where static variables are stored in memory in c?
What does char * * argv mean in c?
Which is the memory area not included in C program? give the reason
What are qualifiers in c?
What is the right type to use for boolean values in c? Is there a standard type?
Explain the difference between strcpy() and memcpy() function?
Are the variables argc and argv are local to main?
Explain what is a program flowchart and explain how does it help in writing a program?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is the use of a semicolon (;) at the end of every program statement?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....