Write a c program to demonstrate Type casting in c?
Answer Posted / shivakumar
#include <stdio.h>
int main()
{
for ( int x = 0; x < 256; x++ ) {
/* Note the use of the int version of x to output a
number and the use
* of (char) to typecast the x into a character
which outputs the
* ASCII character that corresponds to the current
number
*/
printf( "%d = %c\n", x, (char)x );
}
getchar();
}
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
how do you execute a c program in unix.
Dont ansi function prototypes render lint obsolete?
Explain what are preprocessor directives?
How many levels of pointers have?
How can I change the size of the dynamically allocated array?
What is the explanation for cyclic nature of data types in c?
What is meant by errors and debugging?
Is main is user defined function?
All technical questions
What is typedf?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain how can I convert a number to a string?
What does the function toupper() do?
What is a void pointer in c?
What are the functions to open and close the file in c language?