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 is c language and why we use it?

1030


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2103


What is a structure member in c?

976


What are the features of c language?

1038


What is default value of global variable in c?

958


What is a stream water?

1169


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1110


How do you list files in a directory?

1106


Explain 'bus error'?

1040


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1295


What are the two types of functions in c?

972


Stimulate calculator using Switch-case-default statement for two numbers

2938


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

1098


What is the use of bit field?

1148


How can a program be made to print the name of a source file where an error occurs?

1188