why the range of an unsigned integer is double almost than
the signed integer.



why the range of an unsigned integer is double almost than the signed integer. ..

Answer / srinivasu

By default int is declared as unsigned integer.It's range is
0 to 65535.Signed integer range is -32767 to 32768.
A variable declared as Unsigned int doesn't holds a negative
value whereas a signed integer does.So signed and unsigned
integer doesn't differ in the range, but in the kind of
value it holds.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C Code Interview Questions

#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


source code for delete data in array for c

1 Answers   TCS,


Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print

2 Answers  


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,






Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


why nlogn is the lower limit of any sort algorithm?

0 Answers  


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 Answers  


In a gymnastic competition, scoring is based on the average of all scores given by the judges excluding the maximum and minimum scores. Let the user input the number of judges, after that, input the scores from the judges. Output the average score. Note: In case, more than two judges give the same score and it happens that score is the maximum or minimum then just eliminate two scores. For example, if the number of judges is 5 and all of them give 10 points each. Then the maximum and minimum score is 10. So the computation would be 10+10+10, this time. The output should be 10 because 30/3 is 10.

0 Answers   TCS,


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

0 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  


Categories