1 votes 1 votes What does the following program print? int data[3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int main(void) { int r, c; for(r = 0; r < 3; r++) for(c = 0; c < 4; c++) if(r != c) printf("%3d,", *(*(data + c) + r) + 10); return 0; } Programming in C programming-in-c output virtual-gate-test-series + – sushmita asked Mar 27, 2017 edited Apr 14, 2019 by Lakshman Bhaiya sushmita 392 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 3 votes 3 votes please find the below screen shot for clear explanation,output is as follows: 15, 19, randomGarbageValue+10, 12, 20, randomGarbageValue+10, 13, 17, randomGarbageValue+10, karthikmadupu answered Mar 27, 2017 edited Apr 14, 2019 by Lakshman Bhaiya karthikmadupu comment Share Follow See all 2 Comments See all 2 2 Comments reply sushmita commented Mar 27, 2017 reply Follow Share nice answer. Code should be c<3 to avoid garbage values. 0 votes 0 votes karthikmadupu commented Mar 30, 2017 reply Follow Share Yeah garbage values can be avoided if c<3 If c<3 in for loop then the output will be: 15, 19, 12, 20, 13, 17 0 votes 0 votes Please log in or register to add a comment.