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

can main method be overloaded...??? How..????

2 Answers   Satyam,


what is the function of 'this' operator ?

7 Answers   Wipro,


what is code for call by value and call by reference?

1 Answers  


What is virtual function?where and when is it used?

2 Answers   Sitel,


Can destructor be overloaded?

0 Answers  






What is the default size allocated for array in the statement if size not specified " int a[] "

4 Answers   CTS,


different types of castings

3 Answers   Siemens,


What is property in oops?

0 Answers  


what is the difference between inter class and abstract class...?

0 Answers  


Can java compiler skips any statement during compilation time?

0 Answers  


what is the sylabus for priliminaries?

0 Answers  


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

0 Answers  


Categories