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


Please Help Members By Posting Answers For Below Questions

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?

579


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2201


What is printf () in c?

578


What does the error 'Null Pointer Assignment' mean and what causes this error?

741


What is the use of bitwise operator?

690






What is header file definition?

567


What is selection sort in c?

611


In C language, a variable name cannot contain?

745


What are keywords in c with examples?

604


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 ].

643


Can we increase size of array in c?

542


Explain zero based addressing.

608


What is #include stdio h and #include conio h?

603


How do you define a function?

583


Explain the use of bit fieild.

715