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 |
write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words
5 Answers Captronic, DELL, Google, IBM, Mithi, RCC, Wipro,
What is an lvalue?
Suggesting that there can be 62 seconds in a minute?
difference between spiral and waterfall model
Which node is more powerful and can handle local information processing or graphics processing?
define c
Can the curly brackets { } be used to enclose a single line of code?
What is I ++ in c programming?
When should a far pointer be used?
If input is 123 then how to print 100 and 20 and 3 seperately?
why array index always starts from zero??
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