How to find the digits truncation when assigning the
interger variable to the character variables.
like int i=500; char x = i : here we have truncation. how to
find this.
another ex: i =100; char x=i. here we do not have
truncation.
Answer / ashu
when i=500 in int which means it is not going beyond the limit of integer range in memory but when x=i which means we are assigning value of i to x.. that is now x becomes 500 whose data type is "char" and range is only -128 to 127 in signed & 0 to 255 in unsigned.. i.e. it is crossing the range.. there we find truncation here
where as in 2nd ex: i=100 which then x=i in char datatype that is char x variable is assigned with i=100 which is not byond range of char data type..therefor no truncation in this example we can find.
| Is This Answer Correct ? | 3 Yes | 1 No |
What is the difference between #include <header file> and #include “header file”?
What are the advantages and disadvantages of a heap?
Explain bitwise shift operators?
Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);
an algorithem for the implementation of circular doubly linked list
print ur name 20,000 times without using inbuilt library functions like printf,scanf,gets,puts,getchar or putchar
What is restrict keyword in c?
what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question
how to use virual function in real time example
Why isn't any of this standardized in c? Any real program has to do some of these things.
what will be the out put. #include<stdio.h> void main() { printf("Output:"); printf(1+"vikashpatel"); }//output: ikashpatel
please send me papers for Dy. manager IT , PNB. it would be a great help for me.