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 function pointer c?

0 Answers  


What is null in c?

0 Answers  


FILE PROGRAMMING

0 Answers   Wipro,


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

0 Answers   CSC, Wipro,


what is the difference between exit() and _exit() functions?

2 Answers  


what different between c and c++

1 Answers  


in iso what are the common technological language?

0 Answers  


is forign key will be unique key any table or not?

2 Answers  


how do we remove the printed character in printf statement and write next it it

1 Answers  


Can you return null in c?

0 Answers  


program for following output using for loop? 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

8 Answers   Aptech, Infosys,


what is the purpose of the code, and is there any problem with the code? int f( int n, int l, int r ) { return (n << l) >> r; }

2 Answers   Google,


Categories