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 print largest number of each row of a 2D array
What is void c?
What does char * * argv mean in c?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Do pointers take up memory?
write a c program to find largest number in matrix(in each row,each column, diagonally, and in the whole matrix)? Its urgent.
Why isn't any of this standardized in c? Any real program has to do some of these things.
Why do we use pointer to pointer in c?
What do you mean by recursion in c?
What is bubble sort in c?
Can you explain the four storage classes in C?
what is level of tree if leaf node is at level 4.please explain.