450 views

2 Answers

1 votes
1 votes

Output will be 5,99,2

But if the a[3]= 78 was not commented, compiler would have thrown error as you are modifying const variable.

0 votes
0 votes
This code will show error because we cannot change the value of const int either directly or by any pointer

Related questions

0 votes
0 votes
0 answers
2
Tejeshwara asked Jun 12, 2022
461 views
int main(int argc, char *argv[]) { int valid = 0; char str1[8] = "start"; char str2[8]; gets(str2); if (strncmp(str1, str2, 8) == 0) valid = 1; printf("buffer1: str1(%s),...
1 votes
1 votes
3 answers
3
jverma asked May 23, 2022
1,029 views
#include <stdio.h>int f(int n){ static int r = 0; if (n <= 0) return 1; r=n; return f(n-1) + r;}int main() { printf("output is %d", f(5)); return 0;}Ou...