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=☺
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 |
Post New Answer View All Answers
What is local and global variable in c?
Is a pointer a kind of array?
Explain the use of 'auto' keyword
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
Explain the use of 'auto' keyword in c programming?
How to draw the flowchart for structure programs?
State the difference between realloc and free.
Explain bitwise shift operators?
What are 'near' and 'far' pointers?
Explain the difference between getch() and getche() in c?
Write a program to reverse a string.
What is the difference between scanf and fscanf?
What is const volatile variable in c?
Is r written in c?
How do you sort filenames in a directory?