Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Two's compliment of -5

Answers were Sorted based on User's Feedback



Two's compliment of -5..

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

Two's compliment of -5..

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

Two's compliment of -5..

Answer / ataraxic

Or in other words
~5+1

Is This Answer Correct ?    6 Yes 3 No

Two's compliment of -5..

Answer / vadivel t

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

Post New Answer

More C Interview Questions

What is dynamic variable in c?

0 Answers  


Explain indirection?

0 Answers  


Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.

11 Answers   Microsoft,


What are disadvantages of C language.

0 Answers   iNautix,


proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?

7 Answers   Hughes,


write a C program : To find out the number of identical words in two files . the file name should be taken as command line argument .

1 Answers   Subex,


can any one tell that i have a variable which is declared as static but i want this variable to be visible to the other files? how?

2 Answers  


to convert a string without using decrement operater and string functions

1 Answers  


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

0 Answers  


what is meant by c

9 Answers   INiTS,


what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason

3 Answers  


Explain is it valid to address one element beyond the end of an array?

0 Answers  


Categories