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

Answers were Sorted based on User's Feedback



1) int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); ..

Answer / 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

1) int main() { unsigned char a = 0; do { printf("%d=%c\n",a,a); ..

Answer / vidyashree b l

0

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

what is difference between c and c++

4 Answers  


How do you list a file’s date and time?

0 Answers  


Tell me about low level programming languages.

0 Answers   Amdocs,


How can you convert integers to binary or hexadecimal?

0 Answers  


What is a string?

0 Answers  


Is c dynamically typed?

0 Answers  


what is a static function

10 Answers   Satyam,


void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }

3 Answers  


What does s c mean on snapchat?

0 Answers  


Can the curly brackets { } be used to enclose a single line of code?

0 Answers  


What is the explanation for prototype function in c?

0 Answers  


where are auto variables stored? What are the characteristics of an auto variable?

0 Answers  


Categories