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 a stack
Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates
Please write the area of a RIGHT ANGLED TRIANGLE.
Which of these functions is safer to use : fgets(), gets()? Why?
What are local static variables? How can you use them?
What is the difference between int main and void main?
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe
input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure
why do some people write if(0 == x) instead of if(x == 0)?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
How do we make a global variable accessible across files? Explain the extern keyword?
to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. The packets are named A, B, C, D, E …….. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….].