What is the following program will print?
#include
int main()
{
int a=0101;
printf("\na=%d",a);
return 0;
}
A)a=101
B)a=5
C)a=65
D)compilation error: not a valid number
Answers
Answered by
0
Answer:
A - a=101 is the answer for the above question
Answered by
1
Output of the given code:
Output:
The output is option C, which is 65.
Explanation:
- In the given C language program code an integer variable "a" is initialized with a value, that is "0101".
- In the next step, a print method is used, that first convert the binary digit into a decimal number, then print its value, that is 65, that's why other choices were wrong, which can be explained as follows:
- Option A and Option B is wrong because the initialized value is not equal to 101 and 5.
- In option D, It can not give a compile-time error.
Learn more:
- Output of the program: https://brainly.in/question/12989974
Similar questions
Computer Science,
5 months ago
Economy,
5 months ago
Science,
9 months ago
Physics,
9 months ago
Social Sciences,
1 year ago
English,
1 year ago
India Languages,
1 year ago