Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program? #include<stdio.h> int main() { const int i=0; printf("%d\n", i++); return 0; } ?->(Show Answer!)
1. What will be the output of the program? #include<stdio.h> int main() { const int i=0; printf("%d\n", i++); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.00 pm
This program will show an error "Cannot modify a const object". Step 1: const int i=0; The constant variable 'i' is declared as an integer and initialized with value of '0'(zero). Step 2: printf("%d\n", i++); Here the variable 'i' is increemented by 1(one). This will create an error "Cannot modify a const object". Because, we cannot modify a const variable.