Write on signed and unsigned integers and give three (3)
examples each



Write on signed and unsigned integers and give three (3) examples each..

Answer / durga.g

signed integers : which contains both the +ve and -ve numbers
. The format specifier for signed integers is %d or we can
use %i also.
the range is same as the int.

Unsigned integers:
the range of unsigned integer is 0to65535.
the format specifier for this is %u.
generally this is used to print the address of a variable.
unsigned integer doesnt contain negative value.
eg:
main()
{
int i;
printf("enter i value");
scanf("%d",&i);
printf("the value stored in the i variable is%d",i);
printf("address is %u",&i);
getch();
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What will happen when the following code is run: int x; while(x<100) { cout<<x; x++; } 1) The computer will output "0123...99" 2) The computer will output "0123...100" 3) The output is undefined

7 Answers  


what is data hiding.

3 Answers   Wipro,


What is purpose of inheritance?

0 Answers  


what is namespace? what are the uses of namespace?

1 Answers  


What is an example of genetic polymorphism?

0 Answers  






In what situation factory design patterns,DAO design patterns,singleton design patterns should be applied.?

2 Answers  


What is difference between oop and pop?

0 Answers  


What is abstraction oop?

0 Answers  


how does a main() in C++ is different from main() in C?

7 Answers  


why c++ is called OOPS? waht is inherutance? what is compiler?

5 Answers  


What does it mean when someone says I oop?

0 Answers  


What is the significance of classes in oop?

0 Answers  


Categories