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...

1) int main() {
unsigned char a = 0;
do {
printf("%d=%c\n",a,a);
a++;
}while(a!=0);
return 0;
}
can anyone please explain the explain the output

Answer Posted / c.p.senthil

ANS: Prints all the ascii characters from 0 to 255 in the below format
0=
1=&#9786;
2=&#9787;
3=&#9829;
4=&#9830;
5=&#9827;
6=&#9824;
.
.
.
251=&#8730;
252=&#8319;
253=²
254=&#9632;
255= 

'a' is a unsigned char variable, size = 8 bits
so the maximum value 'a' can store is 255.
an increment from 'a' value 255 will cause overflow and
'a' value becomes 0, when the loop terminates.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a macro in c preprocessor?

1072


can any one tel me wt is the question pattern for NIC exam

1931


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1041


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1152


What is wild pointer in c with example?

1033


Why should I use standard library functions instead of writing my own?

1223


What happens if header file is included twice?

1104


What are the uses of a pointer?

1125


What is identifiers in c with examples?

1143


Does sprintf put null character?

1008


Difference between MAC vs. IP Addressing

1113


Define Spanning-Tree Protocol (STP)

1088


What is the use of typedef in c?

1009


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1120


Is a house a shell structure?

1125