Initial value of j is 1 and the last condition of the while statement is j=225. so the loop get executed 225 times. It does not change according to declaration.
Vivek Kkumar said:
(Wed, Apr 6, 2011 08:05:01 AM)
I could not understand.
Nayana said:
(Tue, Jun 7, 2011 09:23:12 AM)
Hi vivek in the program the initital value of j=1 the statement in the while condition will execute until j value will become 255. so the statement will execute 255 times
Ravitheja said:
(Sat, Jul 2, 2011 12:22:11 AM)
Thnks to all. Karthi please chek your values in this discussion.
Rachit said:
(Fri, Jul 29, 2011 08:41:19 PM)
Loop will execute from j=0 to 224 at j=225 loop will terminated so it will execute upto 225 times from 0 to 224.
I think it makes it more clear.
Fanta said:
(Mon, Aug 8, 2011 11:44:01 PM)
The body of the while loop will execute 255 times. But the while condition will execte one more time to became condition false.
It takes 256.
Dhronan said:
(Mon, Sep 5, 2011 11:25:49 PM)
@fanta
you are right but see they didn't say while statement, they said while loop, so you ought consider the whole loop statements.
Jaya said:
(Mon, Sep 12, 2011 09:13:30 AM)
In printf, why there are using %c. I can't understand please explain..
Asha said:
(Mon, Sep 12, 2011 05:10:44 PM)
I can't understand using of %c please explain.
Swathi said:
(Tue, Oct 4, 2011 01:43:46 PM)
%c %d means short integer, according to this concept it won't affect while.
Hence while loop get executed by 255 times...understand.
Arun said:
(Tue, Oct 11, 2011 11:00:18 AM)
Good answer.
Manas said:
(Fri, Oct 14, 2011 01:09:26 AM)
Its answer is wrong because character is 127 to -128 so after going to 127 next j++ will take it to -128 so ..loop continues...
Saswati said:
(Wed, Oct 26, 2011 03:57:12 PM)
I coudnt undrstand "%c %d". and also this "j,j" . why two js are used ? have anyone checked output using compiler?
Gowrishankar said:
(Wed, Dec 7, 2011 05:57:09 AM)
Thank you for discussion saswati and navana.
Gowri said:
(Wed, Dec 7, 2011 05:59:50 AM)
%c is used to read character variable means 'g' or 'h' etc
wheare as %d is used to read integer example 22 44 etc
i checked it
Shalini said:
(Thu, Dec 8, 2011 11:22:01 PM)
I think the answer is infinite. Loop continues because in case of characters after 127 next value will be -128. Hence the loop will never come to an end.
Keerthana said:
(Thu, Dec 15, 2011 09:33:21 PM)
In printing statement we have %c to print the j. as u told -128 to +127 ,but the given value is 255. But it is beyond the character limit. So whether here wrap around process will take place here can pls any one explain me clearly..
Eswari said:
(Wed, Dec 28, 2011 01:45:58 PM)
Thank you for swathi and karthi.
Mady said:
(Thu, Jan 5, 2012 08:27:15 PM)
Thank you swathi.
Pavani said:
(Mon, Jan 16, 2012 12:26:16 PM)
The answer is 256 its not 255 because the while loop gets executed when j=255.that is it takes 255 loop.but the while condition is executed untill the condition is failed.