• edited by
1,049 views
2 2 votes

what will be the output:

(a) 3 5 8 8 3 (b) 3 5 7 8 8 (c) compilation error

2 Answers

Best answer
4 4 votes

This question is based on the block scope of a variable.

A variable declared in a block is accessible in the block and all inner blocks of that block but not accessible outside the block.

Hence option a) is correct

• selected by
Position:
Show:

Related questions

1 1 vote
0 0 answers
1.9k
1.9k views
Aibi asked Oct 30, 2017
1,870 views
What is the output of below code considering the size of short int is 2, char is 1 and int is 4 bytes.#include<stdio.h>main(){short int i = 20;char c = 97;printf("%d, %d,...
0 0 votes
1 answers 1 answer
937
937 views
Hemant Parihar asked Feb 3, 2017
937 views
#include<stdio.h>int main() { char *p; p = "%d\n"; p++; p++; printf(p-2, 400); return 0;}Output : 400I ran this program and got 400 as output. But I don...
0 0 votes
1 1 answer
1.0k
1.0k views
2 2 votes
2 2 answers
994
994 views