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 program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
What is the most efficient way to store flag values?
Explain how can I right-justify a string?
what is the height of tree if leaf node is at level 3. please explain
what is the other ways to find a logic to print whether a number is an even or odd wit out using % symbol??????? i know three different ways to print it. so i need any other different logic>>>>>
What is the difference between a free-standing and a hosted environment?
what is the difference between c and java?
what are the various memory handling mechanisms in C ?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
write a programme to convert temperature from farenheit to celcius?
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }
How to establish connection with oracle database software from c language?