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 |
actually i have 2 years teaching experience as computer faculty but now i am a DBA but when i go for interview many peoples asked me why i left my teaching profession and why i want to come in this field kindly give me the proper answer of this queston
How will you allocate memory to double a pointer?
What is the value of h?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
related proverb of "dont count your chicken before it hatches"
which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....
Lists the benefits of c programming language?
What is logical error?
How the processor registers can be used in C ?
hat is a pointer?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
Explain what are the advantages and disadvantages of a heap?