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 / jahid
int a[5]={5,5,5,5,5}
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are header files in c?
What is #define size in c?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
How many levels deep can include files be nested?
Explain Function Pointer?
What is memcpy() function?
What are structures and unions? State differencves between them.
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is volatile variable in c with example?
What is array within structure?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Why void is used in c?
Explain what is wrong with this program statement? Void = 10;
What is getch?