Two's compliment of -5

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the benefit of using #define to declare a constant?

614


What is difference between array and structure in c?

583


What is pass by reference in c?

618


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7413


Why cant I open a file by its explicit path?

597






What is meant by initialization and how we initialize a variable?

590


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

713


int far *near * p; means

3129


Can a void pointer point to a function?

580


Hi can anyone tell what is a start up code?

1620


What is dynamic variable in c?

570


What is #include in c?

604


plz let me know how to become a telecom protocol tester. thank you.

1745


What are the types of type qualifiers in c?

652


How can a program be made to print the line number where an error occurs?

656