Computer Science, asked by tanu236928, 1 month ago

What is the output of C Program?
int main() {
char al] = {'1',2,3,4'};
char b[4] = {'5',6',7,8"};
printf("%d, %d", a[0], b[0]); }​

Answers

Answered by aakashsairajpb
0

Answer:

The Answer will be an error

Explanation:

The elements of a and b are characters and format specifier used in print statement is integer type.

therfore, it will be an type error

Answered by remyanairlm
0

Answer:

The output of the given C program will be:

49, 53

Explanation:

Here, a[] and b[] are two arrays of size 4 each.

In the print statement, we are attempting to print the first elements of both these arrays.

The first element of both the arrays is '1' and '5' of character type.

By specifying "%d, %d" in the print statement, we are attempting to print an integer output.

So, accordingly, the ASCII values corresponding to characters '1' and '5' are printed separated by a comma

Hence, the output turns out to be 49, 53.

Similar questions