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
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 |
what is difference between c and c++
How do you list a file’s date and time?
Tell me about low level programming languages.
How can you convert integers to binary or hexadecimal?
What is a string?
Is c dynamically typed?
what is a static function
void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }
What does s c mean on snapchat?
Can the curly brackets { } be used to enclose a single line of code?
What is the explanation for prototype function in c?
where are auto variables stored? What are the characteristics of an auto variable?