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 |
What is sizeof c?
What do mean by network ?
Which is an example of a structural homology?
Write a program to reverse a given number in c?
Do you have any idea about the use of "auto" keyword?
What is far pointer in c?
write a program to interchange the value between two variable without using loop
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
Ow can I insert or delete a line (or record) in the middle of a file?
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array?
I have a varargs function which accepts a float parameter?
How can I read/write structures from/to data files?