Two's compliment of -5
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
first write the given number in it's binary format.
am considering only 8 bit at a time ,
5- 0000 0101
step 1: convert this binary format to one's compliment (ie)
change 0 to 1 and 1 to 0.
1111 1010
step 2: add 1 to the above binary format.
1111 1010
1
-----------
1111 1011
so this binary format will get stored in memory and the sign
bit will be set to 1.
always the negative number will be stored only in 2's
compliment..........
thank u
| Is This Answer Correct ? | 20 Yes | 2 No |
Answer / ramprasad g
ans: +5
-5 will be stored as 2's complement of 5
2's complement of -5, is thus 2 times 2's complement of 5.
so the ans is 5 itself.
| Is This Answer Correct ? | 11 Yes | 0 No |
2's compliment of a -ve no is, positive value of the same
no.
#include<stdio.h>
#include<conio.h>
void main()
{
int no1, res;
printf("ENTER THE NEGATIVE NO: \n");
scanf("%d", &no1);
no1 = ~(no1);
res = no1 | 0x01;
printf("\nRESULT: %d", res);
getch();
}
| Is This Answer Correct ? | 0 Yes | 5 No |
Define function ?Explain about arguments?
2 Answers Geometric Software, Infosys,
the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789
code for find determinent of amatrix
Why ca not I do something like this?
What is C language ?
how to create c progarm without void main()?
What are different types of operators?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Write a factorial program using C.
Explain what is gets() function?
What is extern keyword in c?
Describe advantages and disadvantages of the various stock sorting algorithms