Data Types
- What is the output of this program?
#include
using namespace std;
int main()
{
char ch = 'M';
cout<< ch;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
M
- How do we represent a wide character of the form wchar_t?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
A wide character is always indicated by immediately preceding the character literal by an L.
- What will be the output of this program?
#include
using namespace std;
int main()
{
char ch = 65;
cout<< ch;
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The literal value for 65 is A. So it will be printing A.
- Which of the following belongs to the set of character types?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
wchar_t and char is used to represent wide character and character.
- Select the right option.
Given the variables a, b are of char type and c, d, e are of int type
i. e = (c * d) / (c + d);
ii. e = (a * b) / (c + d);
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Every character constant has an integer value. Also char belongs to the integral type hence arithmetic and logical operations can be performed on them.