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???
Answers were Sorted based on User's Feedback
#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā%dā ,a[i]); }
Why main is used in c?
write a program to display numbers from 1 to 10 and 10 to 1?
Write a program in C for showing working of different logical operator in C. Your program should guide users with proper message/menu on the console.
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
whats the use of header file in c?
4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. i have done maximum par but i m findind problem in the commented area. please help...
What is the scope of static variables?
Is it valid to address one element beyond the end of an array?
what is the difference between 123 and 0123 in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Explain logical errors? Compare with syntax errors.