{
const int a=5;
a++;
printf(“%d”,a);
}
What will be output?
Ans: compiler error, we cannot modify const variable.
(5) What is meaning of the declaration:
const volatile int a=6;
Ans:
Value of variable cannot be changed by program (due to const) but its value can be changed by external device or hardware interrupt (due to volatile).
Ans: compiler error, we cannot modify const variable.
(5) What is meaning of the declaration:
const volatile int a=6;
Ans:
Value of variable cannot be changed by program (due to const) but its value can be changed by external device or hardware interrupt (due to volatile).
No comments:
Post a Comment