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=☺
2=☻
3=♥
4=♦
5=♣
6=♠
.
.
.
251=√
252=ⁿ
253=²
254=■
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 the -> in c?

0 Answers  


Explain data types & how many data types supported by c?

0 Answers  


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

0 Answers   TCS,


In a switch statement, explain what will happen if a break statement is omitted?

0 Answers  


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

0 Answers   Wipro,


What standard functions are available to manipulate strings?

0 Answers  


Where in memory are my variables stored?

0 Answers  


Explain how do you print an address?

0 Answers  


program for comparing 2 strings without strcmp()

4 Answers  


what is the full form of c language

9 Answers   Satyam, TCS, VNC,


write a c program for print your name .but,your name may be small letter mean print a capital letter or your name may be capital letter mean print a small letter .example \\enter ur name : sankar The name is: SANKAR (or) enter your name:SAnkar The name is:saNKAR

5 Answers  


Categories