=0) { printf("%u",i) i--; }}How many times the loop will get executed 11 times Dear Friends, It will never end because the i is unsigned it will never reach the nagative value. the loop will never executed because 10 is greater tha . 11 members have posted answers.">
GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  Placement Papers
Go To First  |  Previous Question  |  Next Question 
 Placement Papers  |  Question 15 of 23    Print  
Consider the following program
main()
{
unsigned int i=10;
while(i>=0)
{
printf("%u",i)
i--;
}
}
How many times the loop will get executed

  
Total Answers and Comments: 11 Last Update: July 15, 2009     Asked by: sruthi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
August 04, 2006 06:30:51   #1  
ak        

RE: Consider the following programmain(){
11 times
 
Is this answer useful? Yes | No
September 08, 2006 01:19:04   #2  
S.Sabarinathan        

RE: Consider the following programmain(){
Dear Friends It will never end because the i is unsigned it will never reach the nagative value.
 
Is this answer useful? Yes | No
September 10, 2006 16:27:18   #3  
ronit Member Since: September 2006   Contribution: 1    

RE: Consider the following programmain(){

the loop will never executed because 10 is greater than 0


 
Is this answer useful? Yes | No
September 30, 2006 02:28:10   #4  
G.C.V.Rajesh        

RE: Consider the following programmain(){

It becomes an infinite loop.


 
Is this answer useful? Yes | No
October 05, 2006 01:24:28   #5  
ajay        

RE: Consider the following programmain(){
yes its an infine loop program good one anyways
 
Is this answer useful? Yes | No
January 18, 2007 02:13:43   #6  
batche Member Since: January 2007   Contribution: 3    

RE: Consider the following programmain(){

ya frnds

the correct ans will b......

tht the loop will run INFINITE TIMES.....


 
Is this answer useful? Yes | No
February 01, 2007 02:53:08   #7  
APPU        

RE: Consider the following programmain(){
It results an infinite loop
 
Is this answer useful? Yes | No
July 14, 2009 09:20:33   #8  
mirror_vinita Member Since: July 2009   Contribution: 2    

RE: Consider the following programmain(){unsigned int i=10;while(i>=0) { printf("%u",i) i--; }}How many times the loop will get executed
The loop will never get executed because of compilation error odf semicolon at the end of printf Statement.

If that is solved then the loop will execute infinitely.....

 
Is this answer useful? Yes | No
July 14, 2009 09:39:24   #9  
mirror_vinita Member Since: July 2009   Contribution: 2    

RE: Consider the following programmain(){unsigned int i=10;while(i>=0) { printf("%u",i) i--; }}How many times the loop will get executed
The loop won't be executed because of semicolon at the end of printf statement is not available.

Suppose if we have it then it will execute infinitely.

 
Is this answer useful? Yes | No
July 14, 2009 23:02:49   #10  
myogeshchavan97 Member Since: December 2008   Contribution: 28    

RE: Consider the following programmain(){unsigned int i=10;while(i>=0) { printf("%u",i) i--; }}How many times the loop will get executed
This is an infinite loop.because the condition in the loop remains true.
 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape