#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

Is there a way to switch on strings?

0 Answers  


What are the valid places to have keyword “break”?

0 Answers  


How Many Header Files in c?

2 Answers   TCS,


main() { printf("hello%d",print("QUARK test?")); }

5 Answers  


Can I initialize unions?

0 Answers  






Why void main is used in c?

0 Answers  


what is the output of the program and explain why?? #include<stdio.h> void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (ā€œ%d\nā€,j); }

14 Answers   Oracle,


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

0 Answers   Aspire, Infogain,


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

0 Answers  


We can draw a box in cprogram by using only one printf();& without using graphic.h header file?

4 Answers   NIIT,


Can a pointer be static?

0 Answers  


please give code for this 1 2 4 7 11 16

11 Answers   Intel, Wipro,


Categories