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 a macro in c preprocessor?
can any one tel me wt is the question pattern for NIC exam
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is wild pointer in c with example?
Why should I use standard library functions instead of writing my own?
What happens if header file is included twice?
What are the uses of a pointer?
What is identifiers in c with examples?
Does sprintf put null character?
Difference between MAC vs. IP Addressing
Define Spanning-Tree Protocol (STP)
What is the use of typedef in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Is a house a shell structure?