Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Unsigned char c;
for ( c=0;c!=256;c++2)
printf("%d",c);

No. of times the loop is executed ?

Answer Posted / manishsoni

It produce compile time error becoz the statement c++2 is
not allowed here.

if this statement is written as c+=2,then it will give us an
infinite loop between
0--->254----->0---->254...
because it check simply c!=256(mean c is not equal to
256,mean it simply it didnot print the value at 256,that
mean it did not print 256...after 254...and print 0)
------------------------------------------------------------
No. of times the loop is executed ?
------------------------------------------------------------
loop will execute 128 times becoz:
the loop is increased each time by 2 and loop is execute
254 time without zero so
254/2=127
127+1(zero)=128;
so the loop is execute 128 times....
BY:ManisH SonI(MoNu)

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What language is lisp written in?

1170


Is it possible to execute code even after the program exits the main() function?

1283


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1674


What is page thrashing?

1029


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1039


What is the use of header files?

1060


explain what is a newline escape sequence?

1043


Why is c faster?

1018


Why we write conio h in c?

966


What is a macro in c preprocessor?

1056


Explain what is the difference between text files and binary files?

1100


How can you draw circles in C?

1100


Write the syntax and purpose of a switch statement in C.

1043


What are the advantages and disadvantages of a heap?

1148


Explain what is the concatenation operator?

1111