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
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What is printf () in c?
What does the error 'Null Pointer Assignment' mean and what causes this error?
What is the use of bitwise operator?
What is header file definition?
What is selection sort in c?
In C language, a variable name cannot contain?
What are keywords in c with examples?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
Can we increase size of array in c?
Explain zero based addressing.
What is #include stdio h and #include conio h?
How do you define a function?
Explain the use of bit fieild.