0

can any one plz explain me y i am getting 6 and 7 has a value of 38 and 7

#include<iostream> using namespace std; int main() { int a[]={1,3,5,6}; for(int x=1;x<10;x++) { a[x]; cout<<x<<":"<<a[x]<<endl; } } //OUT PUT 1:3 2:5 3:6 4:0 5:0 6:38 7:7 8:0 9:0 //Y I AM GETTING 6&7 HAS 38 AND 7

15th Mar 2017, 3:24 PM
CH.Durga Prasanna Kumar
CH.Durga Prasanna Kumar - avatar
3 ответов
+ 1
it takes garabage values for it
15th Mar 2017, 3:38 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
+ 1
if you execute this code ones again the values are different
15th Mar 2017, 3:38 PM
Mayur Chaudhari
Mayur Chaudhari - avatar
- 1
but still iam getting same values...
15th Mar 2017, 3:40 PM
CH.Durga Prasanna Kumar
CH.Durga Prasanna Kumar - avatar