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

write a program that will accept two integers and will implement division without using the division operator if the second value is an odd number and will implement multiplication without using multiplication operator if the second value is an even number.

1 Answers  


What is a structure in c language. how to initialise a structure in c?

0 Answers  


void main() { int i=5; printf("%d",i+++++i); }

17 Answers   ME,


What is the difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..

5 Answers   Aricent, TCS,


Which driver is a pure java driver

0 Answers   Vertex,


can we define a function in structure?

2 Answers  


Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.

2 Answers   Infosys,


Will Macros support multiple arguments ?

7 Answers   Oracle,


Tell me about low level programming languages.

0 Answers   Amdocs,


main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }

6 Answers  


What is the difference between the expression “++a” and “a++”?

0 Answers  


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

0 Answers  


Categories