Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum

Complete help forum for students preparing for icse iit aieee cbse pmt and other related exams.Stay updated about all 2011 exams.
 
HomeHome  PortalPortal  FAQFAQ  SearchSearch  RegisterRegister  MemberlistMemberlist  UsergroupsUsergroups  Log in  India NewsIndia News  
Keywords
Latest topics
Top posters
abhas
 
Anu..i luv icse...:)
 
G-7
 
siya
 
Candy
 
jOhNy
 
Apurva
 
WinRrule
 
ambili
 
saif
 



Search if you can't find it here

OUTPUT CONFUSION!!

View previous topic View next topic Go down
Go to page : Previous  1, 2
AuthorMessage
Hari
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sat Feb 21, 2009 2:12 am

yes the answer is:
2
15
7
8
10
Back to top Go down
View user profile
akshay
Active member
Active member



PostSubject: Re: OUTPUT CONFUSION!! Sat Feb 21, 2009 2:20 am

check the print statement:

System.out.println(arr[i]);
..its within the 'for' loop and 'i' starts from zero
so the element within the array 'arr' at 0th position (i.e, 2) gets printed first.
Back to top Go down
View user profile
siya
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sat Feb 21, 2009 11:32 am

arre anu,dis 2=arr[0].see in d whloe program arr[0] is untouched.n while printin in d end d loop is stratin frm 0 so first arr[0] will b printed which is 2.hope u got it!!
Back to top Go down
View user profile
Anu..i luv icse...:)
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sun Feb 22, 2009 12:38 am

oh...k...Siya, as_24 and Hari ..thanks a lot ...got it!!! uffff!! at last...

but, 1 thing.....will such questions come in board exam first section?? this is such a long one ...it will take time for us to evaluate!! No
Back to top Go down
View user profile
siya
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sun Feb 22, 2009 12:41 am

ya i think dat such qquestions can surely come
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sun Feb 22, 2009 1:21 pm

ar[0] vill print =2
ar[1] vill print=15

den further how villl 7 ; 8 .10 vud be printed ?????????
Back to top Go down
View user profile
siya
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sun Feb 22, 2009 2:52 pm

arre kanika c carefully dear ki at last while printin d loop is frm 0-5 ,i.e,arr[0],arr[1],arr[2],arr[3] n arr[4] all will b printed.throughout d course of d loop only arr[2] is changed frm 6 to 7.rest arr[3] n arr[4] r not changed newhere so de will b printed like dis only!!
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Sun Feb 22, 2009 5:27 pm

yaa got it....siya thanxxx.............
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 12:16 pm

HEYY FRNDZZZ PLZZZ TELL D OUTPUT OF D PROGRAM...........

a=5
b=9
a+ = a++ - ++b +a
Back to top Go down
View user profile
siya
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 12:23 pm

a=8
b=8
Back to top Go down
View user profile
Hari
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 2:15 pm

no::::
a---6
b--10
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 3:46 pm

wat is d final asnwer ofn all calculations.??????????????

wats end value of a???????????
Back to top Go down
View user profile
Hari
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 5:13 pm

a---6
b---10......sure
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 6:17 pm

yaaarr tell answer after calculation........

matlab i mean......aaddd vich r to be added subtract required n den fnal output in 1 digit..............
Back to top Go down
View user profile
Anu..i luv icse...:)
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 6:31 pm

a=5
b=9
a + = a++ - ++b +a
a =a+ a++ - ++b +a
=5+ 5 - 10 +6
a =6
b=10
Back to top Go down
View user profile
siya
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 8:09 pm

yaaaaaaaaaaaa sure a=6 n b=10.....sorry kanika i thought --b instead of ++b....sorrrrrrry its 100% a=6 n b=10...
Back to top Go down
View user profile
kanika rajput
Active member
Active member
avatar


PostSubject: Re: OUTPUT CONFUSION!! Wed Feb 25, 2009 9:27 pm

thanxx frndzzz....... flower
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: OUTPUT CONFUSION!!

Back to top Go down

OUTPUT CONFUSION!!

View previous topic View next topic Back to top
Page 2 of 2Go to page : Previous  1, 2

Permissions in this forum:You cannot reply to topics in this forum
Complete IIT AIEEE ICSE ISC PMT help forum :: Exam papers & Model test papers :: ICSE / ISC exam papers and model test papers-