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 the g value paradox?
What is #include in c?
What is memmove?
without a terminator how can we print a message in a printf () function.
Write a program to reverse a linked list in c.
What is getch?
Program to swap the any two elements in an array containing N number of elements?
1 Answers Bosch, Glenwood, Ugam Solutions,
Differentiate b/w Modify and Update commands giving example.
what is difference between C and C++
Write a program that takes three variables(a,b,c) in as separate parameters and rotates the values stored so that value a goes to b,b,to c and c to a
1,4,8,13,21,30,36,45,54,63,73,?,?.
10 Answers AMB, Franklin Templeton,
What would happen to X in this expression: X += 15; (assuming the value of X is 5)