Data Types
- 0545, 451245123245, ‘p’ and 0X3f are _____ _____ ____ and _____ literals respectively.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Literal integer constants that begin with 0x or 0X are interpreted as hexadecimal and the ones that begin with 0 as octal. The character literal are written within ”.
- What will be the output of this program?
#include
using namespace std;
int main()
{
int P = 20;
cout << "Given integer 'P' with 'true' :" << P && true;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Given integer 'P' with 'true' :20
- What will be output of this program?
#include
using namespace std;
int main()
{
int num = 5;
int num0 = num / -10;
int num1 = num % -10;
cout << num0 << " "<< num1;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Sign of result of mod operation on negative numbers is sign of the dividend.
- What will be output of this function?
#include
using namespace std;
int main()
{
register int p = 15;
int *ptr = &p;
cout << *ptr;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Using & on a register variable may be invalid, since the compiler may store the variable in a register, and finding the address of it is illegal.
- Which of the following is not one of the sizes of the floating point types?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Floating point types occur in only three sizes-float, long double and double.