please answer this question
Attachments:
Answers
Answered by
0
(a).
int a[4] = {12,3,2,4,5,6};
printf("%d",a[8]);
Output:1.
Reason: The compiler won't show any error, It returns unexpected output.
(b) char a[] = "Hello";
printf("%c",a);
Output:0.
Reason: The format specifier should be %s not %c. If it is %s, then output is hello.
Hope this helps!
int a[4] = {12,3,2,4,5,6};
printf("%d",a[8]);
Output:1.
Reason: The compiler won't show any error, It returns unexpected output.
(b) char a[] = "Hello";
printf("%c",a);
Output:0.
Reason: The format specifier should be %s not %c. If it is %s, then output is hello.
Hope this helps!
siddhartharao77:
Gud Luck.
Similar questions
Social Sciences,
7 months ago
Physics,
7 months ago
Math,
7 months ago
Hindi,
1 year ago
Physics,
1 year ago