Write a c program to demonstrate Type casting in c?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / pinkey
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=4,c;
c=short(a+b);
printf("%d",c);
getch();
}
| Is This Answer Correct ? | 7 Yes | 5 No |
HOW TO HANDLE EXCEPTIONS IN C
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance
what is difference between null and nul in c language
In C, What is the #line used for?
What does c mean in basketball?
Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
find largest of 3 no
What are the advantages of using macro in c language?
What are disadvantages of C language.
Which one would you prefer - a macro or a function?
In C language what is a 'dangling pointer'?