2 votes 2 votes main() { static char a[3][4] = { "abcd", "efgh", "ijkl"}; putchar(**a); } a) compilation error b) run time error c)garbage d) none of these Sanjay Sharma asked Feb 18, 2017 Sanjay Sharma 1.5k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Hira Thakur commented Mar 5, 2017 reply Follow Share what is use of putchar getchar and similler terms?? 0 votes 0 votes Sanjay Sharma commented Mar 5, 2017 reply Follow Share Thet are used for displaying and reading single character 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes #include <stdio.h> int main() { static char a[3][4] = {"axcd","efgh","ijkl"}; // a is a 2D array of char // Two times dereference of a : **a == *(*(a+0)+0) // gives the first character of the first row putchar(**a); // prints a putchar(*(*a + 1)); // prints x } dd answered Feb 18, 2017 • selected Feb 18, 2017 by Sanjay Sharma dd comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes prints the first character of the first element of the array 'a'. So ans is option D Abhisek Das answered Feb 18, 2017 Abhisek Das comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes For putchar(x) to print x, x has to be a character. Otherwise it would print undesirable output, Here, **a gives the first character('a') of first character array("abcd"). hacker16 answered Nov 22, 2017 hacker16 comment Share Follow See all 0 reply Please log in or register to add a comment.