#include<stdio.h>
void main()
{
int a [5];
for (i=0; i<=4; i++)
printf(ā€œ%dā€ ,a[i]);
}

Answers were Sorted based on User's Feedback



#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / kalyan chukka

Here it shows i is undefined Symbol.So if declare i as
integer then it prints some garbage value Because Array is
declared but elements are not inserted into the array.So
garbage value is printed on the console

Is This Answer Correct ?    10 Yes 1 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / neelima

it gives a garbage values

Is This Answer Correct ?    10 Yes 2 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / sameer mohammed

It shows us garbage values as because the integer type
array is declared but it is not defined.

Is This Answer Correct ?    6 Yes 2 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / jayakrishna

here array a is declared but it is not initialised,but int
the printf we are printing values of array a[], so it
displays garbage values & cannot directly write i as
variable we must specify its type.

Is This Answer Correct ?    4 Yes 1 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / tanvi jain

as i is not yet declared,so give an error.

Is This Answer Correct ?    0 Yes 0 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / purnima

it gives compile time error because here the var i is not
declared .aIn c a var must be declared before is usage

Is This Answer Correct ?    0 Yes 1 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / guest

0
1
2
3
4

Is This Answer Correct ?    0 Yes 5 No

#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā€..

Answer / kapil

1 2 3 4 5

Is This Answer Correct ?    3 Yes 14 No

Post New Answer

More C Interview Questions

why Language C is plateform dependent

3 Answers   Siemens, Wipro,


WHO WROTE C LANGUAGE?

4 Answers  


write a c programme for add of two numbers with out use of arthematic operators

2 Answers  


Explain what will the preprocessor do for a program?

0 Answers  


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

0 Answers  






In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

0 Answers   Wipro,


What is include directive in c?

0 Answers  


What is alloca() and why is its use discouraged?

1 Answers  


write a program that prints a pascal triangle based on the user input(like how many stages) in an efficient time and optimized code?

3 Answers   Oracle,


write a function which accept two numbers from main() and interchange them using pointers?

3 Answers  


What is call by reference in functions?

1 Answers  


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???

3 Answers   Amdocs, IBM,


Categories